Skip to content

Commit

Permalink
Merge pull request #475 from storybookjs/shilman/support-index-v5
Browse files Browse the repository at this point in the history
Fix 8.1.4+ support for v5 index.json
  • Loading branch information
yannbf authored May 29, 2024
2 parents 9fcbf7e + d05e449 commit b354b9e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/playwright/transformPlaywrightJson.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ function v3TitleMapToV4TitleMap(titleIdToStories: Record<string, V3Story[]>) {
({
type: isV3DocsOnly(stories) ? 'docs' : 'story',
...story,
} satisfies V4Entry)
}) satisfies V4Entry
),
])
);
Expand All @@ -120,7 +120,8 @@ export const transformPlaywrightJson = (index: V3StoriesIndex | V4Index | Unsupp
Object.values((index as V3StoriesIndex).stories)
);
titleIdToEntries = v3TitleMapToV4TitleMap(titleIdToStories);
} else if (index.v === 4) {
// v4 and v5 are pretty much similar, so we process it in the same way
} else if (index.v === 4 || index.v === 5) {
// TODO: Once Storybook 8.0 is released, we should only support v4 and higher
titleIdToEntries = groupByTitleId<V4Entry>(Object.values((index as V4Index).entries));
} else {
Expand Down

0 comments on commit b354b9e

Please sign in to comment.