Run the a11y automigration on postInstall

This commit is contained in:
Kasper Peulen 2024-12-10 15:37:41 +01:00
parent d6a06fbf52
commit 11628b25e8
2 changed files with 19 additions and 1 deletions

View File

@ -38,7 +38,8 @@
},
"./manager": "./dist/manager.js",
"./register": "./dist/manager.js",
"./package.json": "./package.json"
"./package.json": "./package.json",
"./postinstall": "./dist/postinstall.js"
},
"main": "dist/index.js",
"module": "dist/index.mjs",
@ -87,6 +88,9 @@
],
"previewEntries": [
"./src/preview.tsx"
],
"nodeEntries": [
"./src/postinstall.ts"
]
},
"gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae16",

View File

@ -0,0 +1,14 @@
import { JsPackageManagerFactory } from 'storybook/internal/common';
import { type PostinstallOptions } from '../../../lib/cli-storybook/src/add';
export default async function postInstall(options: PostinstallOptions) {
const packageManager = JsPackageManagerFactory.getPackageManager({
force: options.packageManager,
});
await packageManager.executeCommand({
command: 'npx',
args: ['storybook', 'automigrate', 'addonA11yAddonTest'],
});
}