feat(cli): add remove, list, add-theme, and build commands#37
Merged
Conversation
Complete the registry lifecycle so the CLI can manage items, not just create them. All four commands sit on a new shared registry core (src/registry-item.ts) that centralises reading the root + included per-directory registries, locating items, and resolving install commands and docs paths. - remove <name>: full reverse of any add — deletes source files, prunes the registry entry, removes the docs page and its meta.json entry. Confirm-gated by default; skippable with --yes. - list [--type] [--json]: inspect the registry, grouped by kind, with a scriptable JSON mode. - add-theme <name>: rounds out the add-* family, registering a theme-<name> registry:theme item with a starter CSS file and docs page. - build: passthrough to the project's registry:build script (or shadcn build), with project-level package-manager detection. registryHasItem now lives in the shared core and is re-exported from utils so the existing add-* commands pick up identical dedupe behaviour without churn. Adds unit coverage for the shared core and integration coverage for the new commands (add → remove round-trip, list filtering, guards).
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
What
Completes the registry lifecycle — the CLI could only create items, now it can manage them. Four new commands, all built on a shared registry core:
remove <name>add-*— deletes source file(s), prunes theregistry.jsonentry, removes the docs page + itsmeta.jsonentry. Confirm-gated;--yesto skip.list [--type] [--json]--typefilters;--jsonis scriptable.add-theme <name>add-*family — registers atheme-<name>registry:themeitem with starter CSS + docs.buildregistry:build(detects the project's package manager from its lockfile).Why
add-component/add-hook/add-blockexisted, but there was no way to remove, inspect, theme, or build without manually editingregistry.json, deleting source files, and pruning docs by hand — exactly the multi-step wiring this CLI exists to avoid.Closes #
How
src/registry-item.ts— a shared registry core that reads the root + allincluded per-directory registries, locates items, and resolves install commands / docs paths. All four commands sit on it, so they behave identically across the include and flat patterns.registryHasItemmoved into the core and re-exported fromutils.ts, so the existingadd-*commands pick up unified behaviour with zero churn.Type
feat— New featureChecklist
feat/)npm run lintpassesnpm testpasses (81 passed — added a unit suite for the core + integration coverage for the new commands)www/content/docs/cli/options.mdx)Release
Includes a
chore(release): 0.11.0commit (MINOR bump per SemVer 0.x + Conventional Commitsfeat). After merge, cut av0.11.0GitHub Release to trigger the npm publish workflow.Testing
Smoke-tested the built CLI end-to-end in a temp project:
removedeletes source + registry entry + docs and prunesmeta.json;list/--json/--typebehave;add-themewirestheme-<name>; all commands fail loudly outside a registry project.