7.2.5 • Published 11 months ago

@junk-temporary-prototypes/postinstall v7.2.5

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

Storybook Postinstall Utilties

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();
};
7.2.5

12 months ago

7.2.4

12 months ago

7.2.3

12 months ago

7.2.2

12 months ago

7.2.1

12 months ago

7.2.0

12 months ago

7.2.0-alpha.6

12 months ago

7.2.0-alpha.5

12 months ago

7.2.0-alpha.4

12 months ago

7.2.0-alpha.3

12 months ago

7.2.0-alpha.2

12 months ago

7.0.8-alpha.4

12 months ago

7.0.8-alpha.3

12 months ago

7.0.8-alpha.2

12 months ago

7.0.8-alpha.1

12 months ago

7.0.8-alpha.0

12 months ago

7.1.1

1 year ago

7.0.9

1 year ago

7.1.0

1 year ago

7.1.0-beta.2

1 year ago

7.1.0-alpha.1

1 year ago

7.1.0-alpha.0

1 year ago

7.0.8

1 year ago

7.0.7

1 year ago