docs(storybook-angular): document code coverage and the monorepo dependency pitfall#2350
Conversation
✅ Deploy Preview for analog-blog ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for analog-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for analog-app ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughAdds a new exported utility stripAngularSyntheticMappings that parses a sourcemap JSON, detects Angular AOT-generated synthetic output lines (ɵ* statics and metadata/debug IIFEs) via an OXC AST, clears decoded mappings for those generated lines, re-encodes the mappings, and returns the updated map JSON. Integrates this function into the Vite plugin so transforms in test mode rewrite TypeScript-generated maps. Adds dependency Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
62c66c8 to
36736f0
Compare
4fca392 to
4f98868
Compare
4f98868 to
f2fa521
Compare
…ndency pitfall Adds a Code Coverage section to the Storybook integration guide: how to enable the V8 provider for stories, and a Monorepo configuration note explaining that a workspace dependency imported via its package/barrel entry is pre-bundled and served from node_modules, where browser-mode V8 coverage ignores it. The dependency is then reported with 0 hits at its source path and double-counts when its report is merged with the unit-test report. Documents the optimizeDeps.exclude (viteFinal) workaround that serves such dependencies from source so they are instrumented. Closes #2349
f2fa521 to
5405634
Compare
PR Checklist
Closes #2349
Documents code coverage for Storybook + Vitest, including the monorepo pitfall where a workspace dependency imported through its package/barrel entry is reported with 0% coverage in browser V8 mode.
Affected scope
Recommended merge strategy for maintainer [optional]
What is the new behavior?
Adds a Code Coverage section to the Storybook integration guide:
node_modules/.vite/deps. Browser-mode V8 coverage ignores any module served fromnode_modules, so the dependency is reported with 0 hits at its source path even though it executed — and merging that with the unit-test report double-counts the file and lowers the overall percentage. Documents theoptimizeDeps.excludeworkaround (viaviteFinalin.storybook/main.ts) that serves such dependencies from source so they are instrumented.Documentation only — no runtime/code changes.
Test plan
nx format:checkpnpm buildpnpm testVerified the documented
optimizeDeps.excludeworkaround end-to-end inapps/analog-appagainst the real@analogjs/storybook-angular+@storybook/addon-vitestV8 browser pipeline: a transitively-imported workspace dependency went from 0% to correct coverage once excluded from pre-bundling.Does this PR introduce a breaking change?
Other information
Docs only.