Skip to content

Commit

Permalink
Merge pull request #20788 from storybookjs/fix/new-frameworks-automig…
Browse files Browse the repository at this point in the history
…ration-in-angular

CLI: Fix new-frameworks automigration in angular projects
  • Loading branch information
yannbf authored Jan 26, 2023
2 parents bbc8f9b + 9b56a36 commit 8bbcca3
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
12 changes: 12 additions & 0 deletions code/lib/cli/src/automigrate/fixes/new-frameworks.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,18 @@ describe('new-frameworks fix', () => {
).resolves.toBeFalsy();
});

it('in sb 7 with correct structure already', async () => {
const packageJson = { dependencies: { '@storybook/angular': '^7.0.0' } };
await expect(
checkNewFrameworks({
packageJson,
main: {
framework: '@storybook/angular',
},
})
).resolves.toBeFalsy();
});

// TODO: once we have a @storybook/vue-vite framework, we should remove this test
it('in sb 7 with vue and vite', async () => {
const packageJson = {
Expand Down
4 changes: 4 additions & 0 deletions code/lib/cli/src/automigrate/fixes/new-frameworks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,10 @@ export const newFrameworks: Fix<NewFrameworkRunOptions> = {
`);
}

if (!dependenciesToRemove.length && !dependenciesToAdd.length) {
return null;
}

return {
main,
dependenciesToAdd,
Expand Down

0 comments on commit 8bbcca3

Please sign in to comment.