Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ygkn/029e50d9f2d884488386ba616bb3907f to your computer and use it in GitHub Desktop.
Save ygkn/029e50d9f2d884488386ba616bb3907f to your computer and use it in GitHub Desktop.
for file in *.tsx; do
cat > "${file%.tsx}.stories.tsx" << EOF
import { ${file%.tsx} } from "./${file%.tsx}";
import { Meta, StoryObj } from "@storybook/react";
const meta = {
component: ${file%.tsx},
} satisfies Meta<typeof ${file%.tsx}>;
export default meta;
type Story = StoryObj<typeof meta>;
export const Default = {} satisfies Story;
EOF
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment