docs(ui): add stories for Brand page#2468
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
2 Skipped Deployments
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughAdds a Vite pre-plugin Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 1✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
.storybook/main.ts (1)
23-165: Consider splittingviteFinalinto smaller helpers.
viteFinalnow handles three distinct responsibilities in one place. Extracting plugin factories (forstorybook-nuxt-components,storybook-v10-compat, and docgen wrapping) would improve readability and reduce future regression risk.Refactor sketch
async viteFinal(newConfig) { newConfig.plugins ??= [] - // ...large inlined plugin setup and patching... + newConfig.plugins.unshift(createNuxtComponentsVirtualPlugin(newConfig)) + newConfig.plugins.push(createStorybookV10CompatPlugin()) + newConfig.plugins.push(createIgnoreInternalsPlugin()) + wrapVueDocgenPlugin(newConfig.plugins) return newConfig }As per coding guidelines, "Keep functions focused and manageable (generally under 50 lines)".
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: c98aa88c-fd1d-4195-bf72-158ea2b85ab1
📒 Files selected for processing (2)
.storybook/main.tsapp/pages/brand.stories.ts
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
.storybook/main.ts (1)
65-76: Consider keeping thecomponents.d.tsparser in one place.This declaration-shape regex now exists here and in
test/unit/a11y-component-coverage.spec.ts:80-100. Pulling it into a tiny shared helper would keep the Storybook shim and the coverage test aligned if the generatedcomponents.d.tsformat ever shifts.
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
| // Fix: nuxt:components:imports-alias relies on internal Nuxt state that is | ||
| // cleaned up after nuxt.close() in @storybook-vue/nuxt's loadNuxtViteConfig. | ||
| // When that state is gone, `import X from '#components'` is left unresolved | ||
| // and Vite 8 falls through to package-subpath resolution, which fails with | ||
| // "Missing '#components' specifier in 'nuxt' package". | ||
| // This plugin intercepts #components first and serves a virtual module built | ||
| // from the components.d.ts written during the same Nuxt boot. | ||
| // Resolve the Nuxt build dir from Vite's alias map, which can be either a | ||
| // plain-object (Record<string, string>) or Vite's resolved array form | ||
| // (readonly Alias[] where find is string | RegExp). We must handle both | ||
| // without casting to Record<string, string>, which would be unsound for the | ||
| // array form. |
There was a problem hiding this comment.
I feel like everytime we add new stories for pages we have to patch storybook 😆 worth it though!
There was a problem hiding this comment.
also I think this is the thing that has been stopping me from being able to run storybook locally, so will try again later 🫡
There was a problem hiding this comment.
Yeah, I'm hopeful that some of these are resolved when there is a SB v10 version for @storybook-vue/nuxt but might need to upstream some of these or at least open some issues for them if not.
🔗 Linked issue
#2150
🧭 Context
This would enable a storybook mock page, storybook a11y checks, and chromatic visual regression tests for this page as documented by the storybook stories.
📚 Description
Adds stories for Brand page.
Fixes storybook dev server not working with
#componentimports.