Skip to content

Commit

Permalink
fix mdx-gfm automigration when running --skip-install
Browse files Browse the repository at this point in the history
  • Loading branch information
yannbf committed Mar 9, 2023
1 parent 09d2801 commit 62af0ca
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions code/lib/cli/src/automigrate/fixes/mdx-gfm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,12 @@ export const mdxgfm: Fix<Options> = {

async run({ packageManager, dryRun, mainConfigPath, skipInstall }) {
if (!dryRun) {
const packageJson = packageManager.retrievePackageJson();
const versionToInstall = getStorybookVersionSpecifier(packageManager.retrievePackageJson());
await packageManager.addDependencies({ installAsDevDependencies: true, skipInstall }, [
`@storybook/addon-mdx-gfm@${versionToInstall}`,
]);
await packageManager.addDependencies(
{ installAsDevDependencies: true, skipInstall, packageJson },
[`@storybook/addon-mdx-gfm@${versionToInstall}`]
);

await updateMainConfig({ mainConfigPath, dryRun }, async (main) => {
const addonsToAdd = ['@storybook/addon-mdx-gfm'];
Expand Down

0 comments on commit 62af0ca

Please sign in to comment.