Skip to content

feat(cli): add remove, list, add-theme, and build commands#37

Merged
jal-co merged 2 commits into
mainfrom
feat/registry-lifecycle-commands
May 31, 2026
Merged

feat(cli): add remove, list, add-theme, and build commands#37
jal-co merged 2 commits into
mainfrom
feat/registry-lifecycle-commands

Conversation

@jal-co

@jal-co jal-co commented May 31, 2026

Copy link
Copy Markdown
Owner

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:

Command Description
remove <name> Full reverse of any add-* — deletes source file(s), prunes the registry.json entry, removes the docs page + its meta.json entry. Confirm-gated; --yes to skip.
list [--type] [--json] Inspect the registry, grouped by kind. --type filters; --json is scriptable.
add-theme <name> Rounds out the add-* family — registers a theme-<name> registry:theme item with starter CSS + docs.
build Passthrough to the project's registry:build (detects the project's package manager from its lockfile).

Why

add-component/add-hook/add-block existed, but there was no way to remove, inspect, theme, or build without manually editing registry.json, deleting source files, and pruning docs by hand — exactly the multi-step wiring this CLI exists to avoid.

Closes #

How

  • New src/registry-item.ts — a shared registry core that reads the root + all included 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.
  • registryHasItem moved into the core and re-exported from utils.ts, so the existing add-* commands pick up unified behaviour with zero churn.

Type

  • feat — New feature

Checklist

  • Branch follows conventional naming (feat/)
  • Commits follow Conventional Commits
  • npm run lint passes
  • npm test passes (81 passed — added a unit suite for the core + integration coverage for the new commands)
  • Tests added or updated
  • Docs updated (README + www/content/docs/cli/options.mdx)

Release

Includes a chore(release): 0.11.0 commit (MINOR bump per SemVer 0.x + Conventional Commits feat). After merge, cut a v0.11.0 GitHub Release to trigger the npm publish workflow.

Testing

Smoke-tested the built CLI end-to-end in a temp project: remove deletes source + registry entry + docs and prunes meta.json; list/--json/--type behave; add-theme wires theme-<name>; all commands fail loudly outside a registry project.

jal-co added 2 commits May 30, 2026 20:30
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).
@vercel

vercel Bot commented May 31, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
scn-stack Ready Ready Preview, Comment May 31, 2026 3:30am

Request Review

@github-actions github-actions Bot added docs Documentation changes feature New feature or enhancement website Changes to www/ (scnstack.sh) test Tests labels May 31, 2026
@jal-co jal-co merged commit 49f18e7 into main May 31, 2026
5 checks passed
@jal-co jal-co deleted the feat/registry-lifecycle-commands branch May 31, 2026 03:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation changes feature New feature or enhancement test Tests website Changes to www/ (scnstack.sh)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant