Storybook
The Storybook plugin gives every package with a .storybook folder a build-storybook and a storybook task.
Add it
Section titled “Add it”axle add storybookThis writes it into the root axle.toml:
[plugins.storybook]hash = "sha256-…"A package or project with a .storybook/main file, .ts, .mts, .cts, .js, .mjs or .cjs, gets:
| Task | Command | Settings |
|---|---|---|
build-storybook |
storybook build |
inputs the package’s files and .storybook, outputs storybook-static |
storybook |
storybook dev |
persistent, ready when Storybook prints that it started |
Each command runs through the repository’s package manager, such as pnpm exec storybook build, so it uses the version the package installs.
.storybook is added to the inputs because Git may not see it as part of the package’s sources. A build that writes elsewhere, with --output-dir, should set outputs in the package’s axle.toml.
Scripts the repository already has
Section titled “Scripts the repository already has”A package’s own script wins. When its package.json has a script with a task’s name that runs something else, such as "storybook": "storybook dev -p 6006", the plugin leaves that task alone and Axle runs the script. A script that only runs the same command is replaced by the plugin’s task, which runs the same command and adds its settings. The repository’s axle.toml changes a task as it would any other, and wins over the plugin.
Settings
Section titled “Settings”| Setting | Default | Meaning |
|---|---|---|
build |
"build-storybook" |
the name of the build task, or false to leave it out |
dev |
"storybook" |
the name of the dev server task, or false |
[plugins.storybook]hash = "sha256-…"build = "build-stories"The plugin’s answers are kept until a .storybook/main.*, a package.json, pnpm-workspace.yaml or a lockfile changes.