Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@storybook/postinstall

Package Overview
Dependencies
Maintainers
6
Versions
1102
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@storybook/postinstall

Storybook addons postinstall utilities

  • 7.6.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2.6M
decreased by-2.71%
Maintainers
6
Weekly downloads
 
Created
Source

Storybook Postinstall Utilities

A minimal utility library for addons to update project configurations after the addon is installed via the Storybook CLI, e.g. sb add docs.

Each postinstall is written as a jscodeshift codemod, with the naming convention addon-name/postinstall/<file>.js where file is one of { config, addons, presets }.

If these files are present in the addon, the CLI will run them on the existing file in the user's project (or create a new empty file if one doesn't exist). This library exists to make it really easy to make common modifications without having to muck with jscodeshift internals.

Adding a preset

To add a preset to presets.js, simply create a file postinstall/presets.js in your addon:

import { presetsAddPreset } = require('@storybook/postinstall');
export default function transformer(file, api) {
  const root = api.jscodeshift(file.source);
  presetsAddPreset(`@storybook/addon-docs/preset`, { some: 'options' }, { root, api });
  return root.toSource();
};

Keywords

FAQs

Package last updated on 28 Nov 2023

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc