Skip to content

Commit

Permalink
add subpath code comment
Browse files Browse the repository at this point in the history
  • Loading branch information
yannbf committed Jan 30, 2025
1 parent 46aa992 commit b95322e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion scripts/snippets/codemod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,11 @@ export async function runSnippetCodemod({
if (newSnippet.path.includes('.stories')) {
transformedSource = transformedSource
.replace(/\/\/ Replace your-renderer with .*\n/, '')
.replace(/\/\/ Replace your-framework with .*\n/, '');
.replace(/\/\/ Replace your-framework with .*\n/, '')
.replace(
/(import preview from \"#\.storybook\/preview\";)/g,
'// Learn about the # subpath import: https://storybook.js.org/docs/api/csf/csf-factories#subpath-imports\n$1'
);
} else {
transformedSource = transformedSource.replace(
/Replace your-framework with .*\n/,
Expand Down

0 comments on commit b95322e

Please sign in to comment.