feat: add packages/.storybook (Vite, autodocs, no MDX) - #25
Merged
Merged
Conversation
New top-level Storybook config copied from styleguide: reads all packages' stories, drops MDX for autodocs, keeps only DocsContainer + ImageGallery from the doc-block helpers. Run via `yarn storybook` on port 6008. Styleguide left untouched. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #25 +/- ##
=======================================
Coverage ? 91.40%
=======================================
Files ? 408
Lines ? 6903
Branches ? 2220
=======================================
Hits ? 6310
Misses ? 584
Partials ? 9
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. |
@skillsoft/eslint-plugin-gamut
@skillsoft/gamut
@skillsoft/gamut-agent-tools
@skillsoft/gamut-icons
@skillsoft/gamut-illustrations
@skillsoft/gamut-patterns
@skillsoft/gamut-styles
@skillsoft/gamut-tests
@skillsoft/variance
commit: |
…soft-gamut into ajr-new-storybook
Neither is relevant to the stories-as-tests + autodocs scope: addon-designs is unused, and addon-links only served prose MDX that this config no longer loads. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Move storybook (dev) and build-storybook targets off styleguide onto a new packages/.storybook project; repoint scripts and test:stories to it. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Cold caches discovered @emotion/react/jsx-dev-runtime mid-run and reloaded, aborting in-flight story imports (flaked DatePicker, SelectDropdown, Modal in CI). Add it to optimizeDeps.include. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
dreamwasp
reviewed
Sep 24, 2026
dreamwasp
left a comment
Contributor
There was a problem hiding this comment.
wasn't able to test locally but looks solid!
dreamwasp
approved these changes
Sep 24, 2026
LinKCoding
approved these changes
Sep 25, 2026
LinKCoding
left a comment
Contributor
There was a problem hiding this comment.
testing instructions are all passing and the spot check of docs look good!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
feat: stand up packages/.storybook as the Storybook workspace (Vite, autodocs, no MDX)
A new Storybook config at
packages/.storybook, copied from the styleguide's setup, that renders the existing component stories with autodocs and no hand-authored MDX. It's wired up as its own Nx project and becomes the Storybook that the repo's scripts and story tests use. Thestyleguidepackage and its stories stay in place — only its Nx storybook targets move to the new project. The new config currently reads stories from the styleguide package until we start moving them over.Why
Part of the testing/docs revamp: the goal is a single Storybook that can eventually host stories from all packages, with docs coming from autodocs rather than MDX prose pages. This stands up that config in a new location as a copy and shifts the tooling (Nx targets, root scripts, story tests) onto it, so
styleguidekeeps working while we transition.styleguidestays for now and will be retired later. One deviation from the original plan: the config lives at the top levelpackages/.storybook(notgamut/.storybook) so it can pull stories across packages, not just gamut.What's included
project.json(new) — an Nx project namedstorybookwith two targets:dev(@nx/storybook:storybook, port 6006) andbuild-storybook(@nx/storybook:build, outputdist/storybook/styleguide).main.ts— react-vite framework, Emotion transform, and the package source aliases from styleguide, with paths adjusted for the new location. Stories are scoped tostyleguide/src/lib(object form) and exclude.mdx. Addon set trimmed toaddon-docs,addon-a11y,storybook-addon-deep-controls,addon-vitest—addon-linksandaddon-designsare dropped.preview.ts— ported decorators (withEmotion),globalTypes(colorMode / theme / logicalProps / direction),a11y: { test: 'error' },docs.container(DocsContainer), a trimmedstorySort.order, andtags: ['autodocs']. Trimmed of all MDX-only machinery (see below).components/— reduced to justDocsContainer(used bydocs.container) andImageGallery(used by the Icons/Illustrations/Patterns gallery stories). The MDX-authoring doc blocks (Callout, Headers, TableOfContents, TokenTable, ColorScale, Markdown, etc.) are omitted — nothing but MDX pages used them.argTypes/,theming/,manager.ts,assets/— copied as-is.start:storybook→nx run storybook:dev;build-storybook→nx run storybook:build-storybook(both now target the new project instead ofstyleguide).vitest.config.tstest:storiesnow readspackages/.storybook(Vite root moved topackagesto match).packages/styleguide/project.jsonhas itsstorybookandbuild-storybookNx targets removed (lintstays).preview.ts cleanup (MDX-only)
WrappedPre— a source-block styling hack targeting a hardcoded, long-stale Emotion class hash; verified non-functional. Removed.mdxComponentsand thedocs.mdxComponentsparam (CodeOrSourceMdx,HeadersMdx) — MDX prose rendering. Removed.docs.toc— table of contents, meaningful only for long MDX pages. Removed.storySort.order— trimmed from the old MDX-page list (Meta / About / Contributing / FAQs / UX Writing / AI Tooling / …) down to the real component sections:Foundations, Layouts, Typography, Atoms, Molecules, Organisms, *.Notes
styleguide/src/lib; this config reads them from there. When stories co-locate into gamut later, add a{ directory: '../gamut/src', … }entry to thestoriesarray — no other config changes needed.styleguide/src/lib, so the sidebar reads Atoms / Molecules / Organisms / etc. (An earlier wildcard glob produced a spurious "Styleguide/src/lib" tree; the scopeddirectoryform fixes that.)packages/styleguide/.storybookconfig dir is now superseded but left in place — it's no longer launchable via Nx, and removing it is a follow-up.packages/.storybook/project.json. If a storybook target isn't found, runyarn nx reset.Testing instructions
yarn start(oryarn nx run storybook:dev) — serves on http://localhost:6006.ImageGalleryand should render.yarn test:stories— the story suite runs against the new config and passes. (On a cold cache you may see a batch of "Failed to fetch dynamically imported module" errors; re-run — the warm cache is green.)PR Checklist