@properui/cli 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +112 -0
  3. package/dist/index.js +1699 -0
  4. package/package.json +59 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Ayman Shabaro
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,112 @@
1
+ # properui
2
+
3
+ The CLI for [Proper UI](https://github.com/properui/properui) — an accessible React 19 component library built on React Aria Components and Tailwind CSS v4.
4
+
5
+ It copies component **source** into your project (shadcn-style) instead of adding a dependency: you own the files, you can edit them, and `properui diff` still tells you what you changed relative to upstream. If you would rather consume the library as a package, install [`@properui/ui`](https://www.npmjs.com/package/@properui/ui) and skip the CLI.
6
+
7
+ ## Usage
8
+
9
+ No install needed:
10
+
11
+ ```bash
12
+ npx @properui/cli@latest init
13
+ npx @properui/cli@latest add button
14
+ ```
15
+
16
+ Or add it to the project: `pnpm add -D properui`.
17
+
18
+ Requires Node 20+ and a Tailwind CSS v4 project (v3 is rejected with upgrade instructions).
19
+
20
+ Global flags: `--cwd <dir>` runs against another directory; every command accepts `-y, --yes` (accept defaults, never prompt) and `--registry <source>` (a registry base URL **or** a local directory). The registry is resolved in this order: `--registry` → `REGISTRY_URL` → the `registry` field in `components.json` → the built-in default. Set `PROPERUI_DEBUG=1` to print stack traces.
21
+
22
+ ## `init`
23
+
24
+ Configures the current project: detects the framework, TypeScript vs JavaScript, a `src/` folder, the import alias from `tsconfig.json` paths, the Tailwind version and the package manager — then writes `components.json`, `styles/theme.css`, the `cx` utility, the Tailwind `@source` scan line and a `ThemeProvider` in the app entry point.
25
+
26
+ ```bash
27
+ npx @properui/cli@latest init # auto-detect everything
28
+ npx @properui/cli@latest init --nextjs # force the Next.js layout
29
+ npx @properui/cli@latest init --vite # force the Vite layout
30
+ npx @properui/cli@latest init --manual # write the files, leave the entry point alone
31
+ npx @properui/cli@latest init --overwrite # replace components.json and existing files
32
+ npx @properui/cli@latest init --yes # non-interactive (CI)
33
+ ```
34
+
35
+ `components.json` — read by every other command:
36
+
37
+ ```json
38
+ {
39
+ "$schema": "https://properui.dev/schema.json",
40
+ "style": "default",
41
+ "tsx": true,
42
+ "tailwind": { "css": "app/globals.css", "theme": "src/styles/theme.css", "prefix": "" },
43
+ "aliases": { "components": "@/components", "utils": "@/utils", "ui": "@/components/base", "hooks": "@/hooks" },
44
+ "registry": "https://properui.dev/r"
45
+ }
46
+ ```
47
+
48
+ ## `add`
49
+
50
+ Resolves each component plus its registry dependencies recursively, copies the files to the targets from `components.json`, rewrites `@/` imports to your alias, installs any missing npm packages and prints exactly what changed. Running it twice without `--overwrite` reports no changes.
51
+
52
+ ```bash
53
+ npx @properui/cli add button # one component
54
+ npx @properui/cli add button input select table # several at once
55
+ npx @properui/cli add table --overwrite # replace files that already exist
56
+ npx @properui/cli add table --dry-run # print the plan, write nothing
57
+ npx @properui/cli add badges --path src/ui # ignore the alias, write here
58
+ npx @properui/cli add --all # every component in the registry
59
+ ```
60
+
61
+ Unknown names are matched fuzzily, so a typo comes back as a suggestion rather than a stack trace.
62
+
63
+ ## `add example`
64
+
65
+ Adds a whole page example — a dashboard, a settings page, a login screen, a pricing section — together with every component it uses.
66
+
67
+ ```bash
68
+ npx @properui/cli add example settings-01
69
+ npx @properui/cli add example hero-split-image-01
70
+ ```
71
+
72
+ ## `list`
73
+
74
+ Lists what the registry holds, with layer and description.
75
+
76
+ ```bash
77
+ npx @properui/cli list
78
+ npx @properui/cli list --layer base # base · application · marketing · …
79
+ npx @properui/cli list --type example # component · example · util · hook · style
80
+ npx @properui/cli list --json # raw index rows, for scripts
81
+ ```
82
+
83
+ ## `search`
84
+
85
+ Fuzzy search over component names, descriptions and example names.
86
+
87
+ ```bash
88
+ npx @properui/cli search "date"
89
+ npx @properui/cli search "empty state" --limit 5
90
+ ```
91
+
92
+ ## `diff`
93
+
94
+ Shows how the files in your project differ from the registry version — the upgrade path once you have edited copied-in code.
95
+
96
+ ```bash
97
+ npx @properui/cli diff # everything already installed
98
+ npx @properui/cli diff button # just this component
99
+ ```
100
+
101
+ ## `login`
102
+
103
+ Only needed for a private registry; the public one is anonymous. Stores the token at `~/.properui/auth.json`.
104
+
105
+ ```bash
106
+ npx @properui/cli login
107
+ npx @properui/cli login --token <token> # non-interactive
108
+ ```
109
+
110
+ ## License
111
+
112
+ MIT © Ayman Shabaro. See [LICENSE](./LICENSE).