Socket
Socket
Sign inDemoInstall

@storybook/postinstall

Package Overview
Dependencies
0
Maintainers
8
Versions
1098
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

@storybook/postinstall

Storybook addons postinstall utilities


Version published
Maintainers
8
Weekly downloads
4,191,957
decreased by-8.21%

Weekly downloads

Changelog

Source

7.6.17

  • Addon-docs: Fix Table of Contents heading leak - #23677, thanks @vmizg!
  • Core: Update ip version to fix CVE-2023-42282 - #26086, thanks @drik98!

Readme

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

Last updated on 20 Feb 2024

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc