Security News
ESLint is Now Language-Agnostic: Linting JSON, Markdown, and Beyond
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
@storybook/postinstall
Advanced tools
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.
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();
};
FAQs
Storybook addons postinstall utilities
The npm package @storybook/postinstall receives a total of 2,770,064 weekly downloads. As such, @storybook/postinstall popularity was classified as popular.
We found that @storybook/postinstall demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 8 open source maintainers collaborating on the project.
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.
Security News
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
Security News
Members Hub is conducting large-scale campaigns to artificially boost Discord server metrics, undermining community trust and platform integrity.
Security News
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.