Generator-first Playwright screenshot testing for Storybook.
Install dependencies with Bun:
bun installCommon local commands:
bun run lint
bun run typecheck
bun run test:bun
bun run build
bun run checkGenerate screenshot specs from a Storybook index:
crvy-strybk generate --config ./strybk.config.tsUse --dry-run to compute outputs without writing files:
crvy-strybk generate --config ./strybk.config.ts --dry-runThe config module should export a StrybkConfig object, typically as the default export from defineConfig(...).
Minimal strybk.config.ts:
import { defineConfig } from "@crvy/strybk";
export default defineConfig({
storybookUrl: "http://localhost:6006",
storyGlobs: ["src/**/*.stories.tsx"],
resolveSpecPath: ({ storyFilePath }) => storyFilePath.replace(/\.stories\.tsx$/, ".spec.ts"),
});Preview the next changelog entry:
bun run changelog:previewRegenerate the full changelog from git history:
bun run changelog:generateBuild the package:
bun run buildRegister this package for local linking:
cd /path/to/strybk
bun linkLink it into the consumer project:
cd /path/to/consumer-project
bun link @crvy/strybkIf you want to persist the link in the consumer's manifest, Bun supports a link: dependency entry:
{
"dependencies": {
"@crvy/strybk": "link:strybk"
}
}