patties add --path
The destination for patties add is hard-coded to app/components/ui/. shadcn's
Purpose
The destination for patties add is hard-coded to app/components/ui/. shadcn's --path lets users redirect where component source is written; the matrix calls this "the only hard-coded convention shadcn users will miss immediately" (matrix §2 --path — gap; "Gaps worth an RFC" #3). This spec adds a per- invocation --path flag, backed by the optional config.ui.componentsDir introduced in [[framework/25-ui-config-block]].
Usage
patties add --path src/ui button # stamp button.tsx into src/ui/
patties add --path packages/web/ui --all
--path overrides the destination for this invocation only. For a durable project-wide change, set config.ui.componentsDir instead ([[framework/25-ui-config-block]]).
Behavior
parseArgsgains a--path <value>option (add.ts:161). It takes the next argv token as its value; a missing value isEXIT.USAGE.- The path is resolved relative to
ctx.cwd. Reject absolute paths and paths that resolve outside the project root →EXIT.USAGE, one-line message. (Same guard as the config block.) - The resolved dir replaces
componentsDirin the path set threaded through the stamper._internal/helpers go to<path>/_internal/(mirrors theinternalDirdefault). ThetokensFileis not affected by--path— only component + helper destinations move; tokens stay where config/convention puts them (one stylesheet per project). - Precedence:
--path>config.ui.componentsDir> convention default (app/components/ui). - Composes with
--dry-run,--view,--force,--all— the plan/preview reflects the redirected destination.
Acceptance criteria
patties add --path src/ui buttonstampssrc/ui/button.tsxandsrc/ui/_internal/cn.ts; nothing lands inapp/components/ui/.--pathwith no following value exitsEXIT.USAGE.- An absolute
--path /etcor a--path ../../outsideexitsEXIT.USAGE; no files written. --pathoverridesconfig.ui.componentsDirfor that invocation only; a laterpatties addwith no flag uses the config/convention value again.patties add --path src/ui --dry-run buttonshowssrc/ui/button.tsxin the plan.tokens.cssdestination is unchanged by--path.