feat: corpus-back all 4 shadcn components (Button, Dialog, Field, Select)#85
Merged
KailasMahavarkar merged 5 commits intomainfrom Apr 21, 2026
Merged
Conversation
Adds corpus support to `src/plugins/shadcn/tools/get-component.ts`. The tool now reads per-component slices from `corpus/frontend/shadcn/<name>.yaml`, validates required fields (category, basePrimitive, dataSlots, usageSnippet, requiresUseClient, pairsWith), and falls back to the in-file `SHADCN_COMPONENTS` registry when the corpus entry is missing or invalid. Creates the shadcn corpus namespace: - `corpus/frontend/shadcn/index.yaml` registers the `frontend.shadcn` namespace and component files - `corpus/frontend/shadcn/button.yaml` captures the Button contract (category, variants, sizes, usage snippet, pairs) - `corpus/index.yaml` registers the new namespace New `tests/shadcn-component-corpus-backed-tools-behaviour.test.ts` asserts corpus source for Button and fallback for Dialog. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds corpus/frontend/shadcn/dialog.yaml with Dialog contract (base-ui primitive, 6 data slots, use-client requirement, full modal usage snippet). Registers dialog in namespace index. Test asserts corpus source for Dialog; fallback check moves to Field. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds corpus/frontend/shadcn/field.yaml with Field contract (base-ui field primitive, vertical/horizontal variants, container-query orientation usage snippet, form-pair components). Registers field in namespace index. Test asserts corpus source for Field; fallback check moves to Select. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds corpus/frontend/shadcn/select.yaml with Select contract (base-ui select primitive, sm/md/lg sizes, accessible trigger/value/content/item slots, form pair). Registers select in namespace index so all 4 shadcn components are now corpus-backed. Test asserts corpus source for Select; the former fallback assertion is replaced because no un-migrated component remains. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
Summary
src/plugins/shadcn/tools/get-component.tswith a generic per-component loader that validates required fields and falls back to the in-file SHADCN_COMPONENTS registry when a slice is missing or invalidfrontend.shadcncorpus namespace and 4 component slices: Button, Dialog, Field, Selectfrontend.shadcnincorpus/index.yamltests/shadcn-component-corpus-backed-tools-behaviour.test.tsasserts corpus source for every migrated componentTest plan