Skip to content

Commit

Permalink
fix problem, manual test, the postinstall runs correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
ndelangen committed Dec 10, 2024
1 parent 9c005ef commit 92eec54
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions code/addons/test/src/postinstall.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,27 +84,26 @@ export default async function postInstall(options: PostinstallOptions) {
});

if (out.migrateToExperimentalNextjsVite) {
console.log('running migrateToExperimentalNextjsVite');
await packageManager.addDependencies({ installAsDevDependencies: true }, [
'@storybook/experimental-nextjs-vite',
]);

await packageManager.removeDependencies({}, ['@storybook/nextjs']);

const node = config.getFieldNode(['framework']);

traverse(node, {
// eslint-disable-next-line no-underscore-dangle
traverse(config._ast, {
StringLiteral(path) {
if (path.node.value === '@storybook/nextjs') {
path.node.value = '@storybook/experimental-nextjs-vite';
}
},
});

config.setFieldNode(['framework'], node as types.Expression);

await writeConfig(config, mainJsPath);

info.frameworkPackageName = '@storybook/experimental-nextjs-vite';
info.builderPackageName = '@storybook/builder-vite';
}
}

Expand All @@ -122,6 +121,7 @@ export default async function postInstall(options: PostinstallOptions) {
)
? info.rendererPackageName
: null;

const isRendererSupported = !!annotationsImport;

const prerequisiteCheck = async () => {
Expand Down

0 comments on commit 92eec54

Please sign in to comment.