{"_id":"@effinrich/forgekit-nx-storybook","_rev":"3-600da19fe27176f6d5cfa1d8eaf507bb","name":"@effinrich/forgekit-nx-storybook","dist-tags":{"latest":"1.0.0"},"versions":{"0.2.0":{"name":"@effinrich/forgekit-nx-storybook","version":"0.2.0","keywords":["nx","nx-plugin","storybook","react","testing","code-generation","interaction-tests","playwright","accessibility","a11y","story-generation"],"author":{"name":"Rich Tillman"},"license":"MIT","_id":"@effinrich/forgekit-nx-storybook@0.2.0","maintainers":[{"name":"effinsnafu","email":"richtillman@gmail.com"}],"homepage":"https://github.com/effinrich/forgekit-nx-storybook#readme","bugs":{"url":"https://github.com/effinrich/forgekit-nx-storybook/issues"},"dist":{"shasum":"cc58c2651c2d642e5cc76e08f8f0f5e552093389","tarball":"https://registry.npmjs.org/@effinrich/forgekit-nx-storybook/-/forgekit-nx-storybook-0.2.0.tgz","fileCount":15,"integrity":"sha512-0gua/7Fn8MQ2ZCX3SEeiy5b777tST79Ael9mvsV127f/7VQb+eFubTLnev2q8/2mYuwoJPwzPCFtVR/tRtQ5hA==","signatures":[{"sig":"MEUCIGcHuG9kJDS5vBwZ4dEJbTyGsvw8MoAzplCiWo45B60jAiEA6a7fZQneVxPQQofmARbCH1ZaRaugr+iIHlDajo28QHA=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":18187},"main":"./src/index.js","gitHead":"d349509b9c384f5c226161d6de70555b85e00b1a","_npmUser":{"name":"effinsnafu","email":"richtillman@gmail.com"},"executors":"./executors.json","generators":"./generators.json","repository":{"url":"git+https://github.com/effinrich/forgekit-nx-storybook.git","type":"git"},"_npmVersion":"11.11.0","description":"Nx companion plugin that auto-generates Storybook stories, interaction tests, Playwright component tests, and accessibility audits from React component analysis","directories":{},"_nodeVersion":"25.8.1","dependencies":{"tslib":"^2.3.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"peerDependencies":{"nx":">=19.0.0","storybook":">=10.0.0","@nx/devkit":">=19.0.0","typescript":">=5.0.0","@nx/storybook":">=19.0.0"},"_npmOperationalInternal":{"tmp":"tmp/forgekit-nx-storybook_0.2.0_1774770012473_0.8560595105836262","host":"s3://npm-registry-packages-npm-production"},"deprecated":"Moved to forgekit-storybook-mcp — install that instead"},"1.0.0":{"name":"@effinrich/forgekit-nx-storybook","version":"1.0.0","keywords":["storybook","react","testing","code-generation","interaction-tests","playwright","accessibility","a11y","story-generation"],"author":{"name":"Rich Tillman"},"license":"MIT","_id":"@effinrich/forgekit-nx-storybook@1.0.0","maintainers":[{"name":"effinsnafu","email":"richtillman@gmail.com"}],"homepage":"https://github.com/effinrich/forgekit#readme","bugs":{"url":"https://github.com/effinrich/forgekit/issues"},"bin":{"forgekit":"bin/forgekit.js"},"dist":{"shasum":"97f37cfb0860bbfa547017260d6baca732a2f920","tarball":"https://registry.npmjs.org/@effinrich/forgekit-nx-storybook/-/forgekit-nx-storybook-1.0.0.tgz","fileCount":27,"integrity":"sha512-eGwQ5ak0qjxlq7Ia3HsKnyg1YlYxfdBnQG8gkbhIcqh9Z/eTjYWV3PIkRPYZpmA9m6TQd3SiEB8zkdsAJleKvA==","signatures":[{"sig":"MEYCIQCv8v+oU7eA8o4QYyCFnZGo8Q0Wg1FUq0hVT+dykDjZYwIhALcZ+fmRFTB1dvUYrqrL6SQ7iPHfqpV3SdYcJmVt4kEU","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":333454},"main":"./dist/index.js","types":"./dist/index.d.ts","module":"./dist/index.mjs","engines":{"node":">=18.17.1"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"}},"gitHead":"f25ec78d059e8c0a7958a620ce1e30c2a6a9acf0","scripts":{"dev":"tsup --watch","lint":"tsc --noEmit","test":"vitest run","build":"tsup","release":"commit-and-tag-version","typecheck":"npx tsc --noEmit","test:watch":"vitest","postrelease":"git push --follow-tags origin main && npm publish --access public","release:major":"commit-and-tag-version --release-as major","release:minor":"commit-and-tag-version --release-as minor","prepublishOnly":"npm run build"},"_npmUser":{"name":"effinsnafu","email":"richtillman@gmail.com"},"repository":{"url":"git+https://github.com/effinrich/forgekit.git","type":"git"},"_npmVersion":"11.11.0","description":"Auto-generate Storybook stories, interaction tests, Playwright component tests, and accessibility audits from React component analysis","directories":{},"_nodeVersion":"25.8.1","dependencies":{"chalk":"^5.4.1","yargs":"^17.7.2","chokidar":"^4.0.3","fast-glob":"^3.3.3"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.4.0","vitest":"^3.0.0","typescript":"^5.7.3","@types/node":"^22.13.0","@types/yargs":"^17.0.33","commit-and-tag-version":"^12.7.1"},"peerDependencies":{"storybook":">=8.0.0","typescript":">=5.0.0"},"peerDependenciesMeta":{"storybook":{"optional":true},"typescript":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/forgekit-nx-storybook_1.0.0_1774827048892_0.40678530492367715","host":"s3://npm-registry-packages-npm-production"},"deprecated":"Moved to forgekit-storybook-mcp — install that instead"}},"time":{"created":"2026-03-29T07:40:12.411Z","modified":"2026-05-08T14:36:18.630Z","0.2.0":"2026-03-29T07:40:12.600Z","1.0.0":"2026-03-29T23:30:49.050Z"},"bugs":{"url":"https://github.com/effinrich/forgekit/issues"},"author":{"name":"Rich Tillman"},"license":"MIT","homepage":"https://github.com/effinrich/forgekit#readme","keywords":["storybook","react","testing","code-generation","interaction-tests","playwright","accessibility","a11y","story-generation"],"repository":{"url":"git+https://github.com/effinrich/forgekit.git","type":"git"},"description":"Auto-generate Storybook stories, interaction tests, Playwright component tests, and accessibility audits from React component analysis","maintainers":[{"name":"effinsnafu","email":"richtillman@gmail.com"}],"readme":"# ForgeKit\n\nAuto-generate Storybook stories, interaction tests, Playwright component tests, and accessibility audits from React component analysis.\n\nForgeKit analyzes your React components — props, callbacks, union types, features — and generates complete `.stories.tsx` files with controls, variants, interaction tests, and a11y audits. No configuration required.\n\n## Install\n\n```bash\nnpm install -D forgekit\n```\n\n**Peer dependencies** (optional):\n\n- `storybook >= 8.0.0`\n- `typescript >= 5.0.0`\n\nRun `npx forgekit init` to check prerequisites and see what's installed.\n\n## Quick Start\n\n```bash\n# Generate a story for a single component\nnpx forgekit story src/components/Button.tsx\n\n# Generate stories for every component in a directory\nnpx forgekit stories src/components/\n\n# Check coverage without generating anything\nnpx forgekit coverage src/components/\n```\n\n## CLI Commands\n\n### `forgekit story <path>`\n\nGenerate a Storybook story for a single React component.\n\n```bash\nnpx forgekit story src/Button.tsx\nnpx forgekit story src/Button.tsx --dry-run\nnpx forgekit story src/Button.tsx --overwrite --skip-interaction-tests\n```\n\n| Option | Default | Description |\n| --- | --- | --- |\n| `--story-title` | auto-inferred | Custom Storybook title |\n| `--skip-interaction-tests` | `false` | Skip generating play functions |\n| `--overwrite` | `false` | Overwrite existing story file |\n| `--dry-run` | `false` | Preview without writing files |\n\n### `forgekit stories <dir>`\n\nBulk generate stories for all components in a directory.\n\n```bash\nnpx forgekit stories src/components/\nnpx forgekit stories src/components/ --include-tests --overwrite\n```\n\n| Option | Default | Description |\n| --- | --- | --- |\n| `--skip-interaction-tests` | `false` | Skip generating play functions |\n| `--overwrite` | `false` | Overwrite existing story files |\n| `--dry-run` | `false` | Preview without writing files |\n| `--include-tests` | `false` | Also generate Playwright component tests |\n\n### `forgekit test <path>`\n\nGenerate a Playwright component test for a React component.\n\n```bash\nnpx forgekit test src/Button.tsx\nnpx forgekit test src/Button.tsx --dry-run\n```\n\n| Option | Default | Description |\n| --- | --- | --- |\n| `--overwrite` | `false` | Overwrite existing test file |\n| `--dry-run` | `false` | Preview without writing files |\n\n### `forgekit watch <dir>`\n\nWatch a directory and auto-generate stories when components change.\n\n```bash\nnpx forgekit watch src/components/\nnpx forgekit watch src/components/ --debounce 500\n```\n\n| Option | Default | Description |\n| --- | --- | --- |\n| `--skip-interaction-tests` | `false` | Skip generating play functions |\n| `--debounce` | `300` | Debounce interval in milliseconds |\n\n### `forgekit coverage <dir>`\n\nReport story coverage for a directory without generating files.\n\n```bash\nnpx forgekit coverage src/components/\nnpx forgekit coverage src/components/ --json\n```\n\n| Option | Default | Description |\n| --- | --- | --- |\n| `--json` | `false` | Output results as JSON |\n\nCoverage grades: **A** (≥ 90%) · **B** (≥ 75%) · **C** (≥ 50%) · **D** (≥ 25%) · **F** (< 25%)\n\n### `forgekit init`\n\nCheck prerequisites and display the setup guide.\n\n## What Gets Generated\n\nFor each component, ForgeKit can generate up to **9 Storybook stories**:\n\n| Story | Condition | Tests |\n| --- | --- | --- |\n| **Default** | Always | Component with default/required props |\n| **Sizes** | `size` prop with union values | All size variants side by side |\n| **Variants** | `variant` prop with union values | All style variants |\n| **ColorPalettes** | `colorPalette` prop with union values | All color options |\n| **Disabled** | `disabled`/`isDisabled` prop | Disabled state rendering |\n| **ClickInteraction** | Any `onClick`/`onPress` callback | Click fires handler |\n| **KeyboardNavigation** | Any interactive callback | Tab focus + Enter triggers |\n| **RendersCorrectly** | Always | Mounts without crashing |\n| **AccessibilityAudit** | Always | axe-core a11y check |\n\nAnd up to **7 Playwright test cases** (visual regression, interaction, accessibility).\n\n## Programmatic API\n\n```typescript\nimport {\n  forgeStory,\n  forgeStories,\n  forgeTest,\n  analyzeComponent,\n  generateStoryContent,\n  scoreCoverage,\n  scanDirectory,\n  watchDirectory,\n} from 'forgekit';\n```\n\n### `forgeStory(options)`\n\nAnalyze a component, generate a story, and optionally write it to disk.\n\n```typescript\nconst result = await forgeStory({\n  componentPath: 'src/Button.tsx',\n  overwrite: false,\n  dryRun: false,\n});\n// result: { storyPath, content, analysis, storiesGenerated, written }\n```\n\n### `forgeStories(options)`\n\nBulk generate stories for all components in a directory.\n\n```typescript\nconst result = await forgeStories({\n  dir: 'src/components',\n  includeComponentTests: true,\n});\n// result: { generated, failed, alreadyCovered, notAnalyzable, total, coverage, errors }\n```\n\n### `forgeTest(options)`\n\nGenerate a Playwright component test for a component.\n\n```typescript\nconst result = await forgeTest({\n  componentPath: 'src/Button.tsx',\n});\n// result: { testPath, content, analysis, written }\n```\n\n### `analyzeComponent(filePath)`\n\nLow-level: parse a React component and extract props, imports, features, and export type.\n\n```typescript\nconst analysis = analyzeComponent('src/Button.tsx');\n// analysis: { componentName, props, imports, features, exportType }\n```\n\n### `scoreCoverage(covered, total)`\n\nCalculate coverage percentage and letter grade.\n\n```typescript\nconst report = scoreCoverage(8, 10);\n// report: { covered: 8, total: 10, percentage: 80, grade: 'B' }\n```\n\n## Component Analysis\n\nForgeKit detects:\n\n- **Props** — name, type, required, callbacks, union values (`'sm' | 'md' | 'lg'`)\n- **Features** — children, React Router, React Query, Chakra UI\n- **Export type** — default, named, or both\n- **Patterns** — `React.forwardRef`, `React.memo`, intersection types\n\nControls are auto-mapped: `text`, `number`, `boolean`, `select` (for unions), `action` (for callbacks).\n\n## Requirements\n\n- Node.js ≥ 18.17.1\n- React components (`.tsx` / `.jsx`)\n- Storybook ≥ 8.0.0 (optional peer dep — CLI works without it for dry-run/analysis)\n\n## License\n\nMIT\n","readmeFilename":"README.md"}