Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Addon A11y: Run the a11y automigration on postInstall #30004

Merged
merged 8 commits into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion code/addons/a11y/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -87,6 +88,9 @@
],
"previewEntries": [
"./src/preview.tsx"
],
"nodeEntries": [
"./src/postinstall.ts"
]
},
"gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae16",
Expand Down
12 changes: 12 additions & 0 deletions code/addons/a11y/src/postinstall.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { spawn } from 'child_process';

export default async function postInstall() {
await new Promise<void>((resolve) => {
const child = spawn('npx', ['storybook', 'automigrate', 'addonA11yAddonTest'], {
kasperpeulen marked this conversation as resolved.
Show resolved Hide resolved
kasperpeulen marked this conversation as resolved.
Show resolved Hide resolved
stdio: 'inherit',
});
child.on('close', (code) => {
resolve();
kasperpeulen marked this conversation as resolved.
Show resolved Hide resolved
});
});
kasperpeulen marked this conversation as resolved.
Show resolved Hide resolved
}
Loading