Skip to content

creevey/strybk

Repository files navigation

strybk

Generator-first Playwright screenshot testing for Storybook.

Development

Install dependencies with Bun:

bun install

Common local commands:

bun run lint
bun run typecheck
bun run test:bun
bun run build
bun run check

CLI

Generate screenshot specs from a Storybook index:

crvy-strybk generate --config ./strybk.config.ts

Use --dry-run to compute outputs without writing files:

crvy-strybk generate --config ./strybk.config.ts --dry-run

The 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"),
});

Changelog

Preview the next changelog entry:

bun run changelog:preview

Regenerate the full changelog from git history:

bun run changelog:generate

Local Linking

Build the package:

bun run build

Register this package for local linking:

cd /path/to/strybk
bun link

Link it into the consumer project:

cd /path/to/consumer-project
bun link @crvy/strybk

If you want to persist the link in the consumer's manifest, Bun supports a link: dependency entry:

{
  "dependencies": {
    "@crvy/strybk": "link:strybk"
  }
}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors