Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
5 changes: 5 additions & 0 deletions .changeset/slimy-rivers-think.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'sv': patch
---

Always add Storybook after all other addons
7 changes: 6 additions & 1 deletion packages/cli/lib/install.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,11 @@ async function runAddon({ addon, multiple, workspace }: RunAddon) {
// but works for now in contrary to the previouse implementation
function orderAddons(addons: Array<Addon<any>>, setupResults: Record<string, AddonSetupResult>) {
return addons.sort(
(a, b) => setupResults[a.id]?.dependsOn?.length - setupResults[b.id]?.dependsOn?.length
(a, b) => {
// Adding storybook last means it will correctly detect and integrate with other addons like vitest and eslint
if (a.id === 'storybook') return 1;
if (b.id === 'storybook') return -1;
return setupResults[a.id]?.dependsOn?.length - setupResults[b.id]?.dependsOn?.length;
}
);
}