wensity 0.1.11 → 0.1.13

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 (3) hide show
  1. package/README.md +169 -40
  2. package/dist/index.js +2289 -647
  3. package/package.json +25 -12
package/README.md CHANGED
@@ -1,63 +1,192 @@
1
1
  # Wensity CLI
2
2
 
3
- Install open-code components and UI primitives from the Wensity registry into your project. There is no `@wensity/ui` runtime dependency and no theme provider to wire up.
3
+ The command line tool for [Wensity](https://ui.wensity.com). Install React
4
+ components, UI primitives, and shareable Tailwind CSS presets into your project
5
+ as source code you own.
6
+
7
+ There is no `@wensity/ui` runtime dependency and no theme provider to wire up.
8
+ Everything the CLI installs lands in your repository as plain files you can read,
9
+ edit, and commit.
10
+
11
+ [![npm](https://img.shields.io/npm/v/wensity)](https://www.npmjs.com/package/wensity)
12
+ [![license](https://img.shields.io/npm/l/wensity)](./LICENSE)
13
+
14
+ [Docs](https://ui.wensity.com/docs/cli) ·
15
+ [Components](https://ui.wensity.com/components) ·
16
+ [Preset studio](https://ui.wensity.com/create-preset) ·
17
+ [Registry](https://github.com/wensity/registry) ·
18
+ [wensity.com](https://wensity.com)
19
+
20
+ ## Quick start
4
21
 
5
22
  ```bash
6
- # Initialise (defaults: Tabler icons, medium radius)
23
+ # New project, with an app scaffold
24
+ npx wensity@latest init --template next
25
+
26
+ # Existing project
7
27
  npx wensity@latest init
8
28
 
9
- # Or apply a shareable preset from https://ui.wensity.com/create-preset
29
+ # Add a component
30
+ npx wensity@latest add button
31
+ npx wensity@latest add liquid-multimodal-input
32
+ ```
33
+
34
+ Requires Node.js 20 or later. Works with npm, pnpm, yarn, and bun. The CLI
35
+ picks your package manager from the client that invoked it, falling back to the
36
+ lockfile in your project root, and installs component dependencies with it.
37
+
38
+ ## Presets
39
+
40
+ A preset is a shareable code that captures a full visual style: color palette,
41
+ border radius, fonts, and control colors. Build one visually in the
42
+ [preset studio](https://ui.wensity.com/create-preset), copy the `wsty1` code,
43
+ and apply it.
44
+
45
+ ```bash
46
+ # New project, styled from the start
10
47
  npx wensity@latest init --preset <wsty1-code>
11
48
  npx wensity@latest init --preset <wsty1-code> --template next
12
49
 
13
- # Existing project — style + CSS only
50
+ # Existing project, style and CSS only
14
51
  npx wensity@latest apply --preset <wsty1-code>
15
52
 
16
- # Inspect a code before applying
53
+ # See what a code contains before applying it
17
54
  npx wensity@latest preset inspect <wsty1-code>
18
-
19
- # Install a primitive or component
20
- npx wensity@latest add button
21
- npx wensity@latest add liquid-multimodal-input
55
+ npx wensity@latest preset inspect <wsty1-code> --json
22
56
  ```
23
57
 
24
- ## Presets (primitives)
58
+ Applying a preset writes two things:
59
+
60
+ 1. Style settings into `wensity.json` (icon library, radius, fonts, control
61
+ colors).
62
+ 2. A delimited `--primitive-*` CSS block in your Tailwind CSS file.
25
63
 
26
- Generate a preset in the [Create preset studio](https://ui.wensity.com/create-preset) (guide: [`/docs/create-preset`](https://ui.wensity.com/docs/create-preset)). Then run `init --preset` (new project) or `apply --preset` (existing). Settings land in `wensity.json` (`style.iconLibrary`, radius, fonts, control-solid colors) and a delimited `--primitive-*` CSS block in your Tailwind CSS file.
64
+ Later `add` and `update` runs read that style automatically, so newly installed
65
+ components match what is already there. `apply` rewrites the CSS block in place
66
+ and never touches your component source.
27
67
 
28
- Later `wensity add <primitive>` / `wensity update <primitive>` reads that style automatically:
68
+ Plain `init` with no `--preset` refuses to overwrite an existing `wensity.json`
69
+ unless you pass `--force`. To restyle an existing project, prefer
70
+ `apply --preset`.
29
71
 
30
- - Colors, radius, and fonts re-apply into the CSS block
31
- - Tabler ↔ Lucide icon imports transform at install time for **UI primitives only**
32
- - Mandatory dependency swap installs exactly one icon package when icons are used
72
+ ## Icon libraries
33
73
 
34
- Plain `init` (no `--preset`) refuses to overwrite an existing `wensity.json` unless you pass `--force`. Prefer `apply --preset` for style-only updates; `init --preset` also merges `style` (+ CSS) without rewriting installed component source.
74
+ Wensity primitives are authored against [Tabler](https://tabler.io/icons). If
75
+ your project uses [Lucide](https://lucide.dev), set that in your preset or
76
+ `wensity.json` and the CLI rewrites icon imports at install time for UI
77
+ primitives. It installs exactly one icon package, whichever you chose.
78
+
79
+ This transform applies to UI primitives only. Larger composed components ship
80
+ with their icons as authored.
35
81
 
36
82
  ## Commands
37
83
 
38
- | Command | Purpose |
39
- |---|---|
40
- | `wensity init [--preset <code>] [--template next\|vite\|astro\|react-router]` | Create / merge project config |
41
- | `wensity apply --preset <code>` | Apply style + CSS to an existing project |
42
- | `wensity preset inspect <code>` | Decode a preset code |
43
- | `wensity login` | Save a dashboard API token for Pro |
44
- | `wensity logout` | Clear credentials |
45
- | `wensity whoami` | Show current user / plan |
46
- | `wensity list` | List registry entries |
47
- | `wensity add <slug>` | Install source (skips existing files) |
48
- | `wensity update <slug>` | Re-download and overwrite local source |
49
- | `wensity version` | Print `0.1.9` |
50
-
51
- Premium components and blocks require an API token from the Wensity dashboard. Tokens are stored at `~/.config/wensity/credentials.json` with `0600` permissions.
52
-
53
- ## CLI vs shadcn
54
-
55
- | | Wensity CLI | Public shadcn registry (`@wensity/*`) |
56
- |---|---|---|
57
- | Stored presets (`wensity.json` style) | Yes | No |
58
- | Lucide delivery | Yes (CLI transform) | No — Tabler-canonical payloads |
84
+ | Command | What it does |
85
+ | --- | --- |
86
+ | `wensity init` | Create `wensity.json` and local helper files. Optional `--preset` applies style and CSS, optional `--template` scaffolds an app |
87
+ | `wensity apply --preset <code>` | Apply a preset to an existing project, style and CSS only |
88
+ | `wensity preset inspect <code>` | Decode and print a preset code, add `--json` for machine output |
89
+ | `wensity list` | List registry components and blocks |
90
+ | `wensity add <slug...>` | Download component source into your project, skipping files that already exist |
91
+ | `wensity update <slug...>` | Re-download components and overwrite the local copies |
92
+ | `wensity login` | Save a Wensity API token for Pro component access |
93
+ | `wensity logout` | Remove saved credentials |
94
+ | `wensity whoami` | Verify the saved token and print the account and plan |
95
+ | `wensity version` | Print the CLI version |
96
+
97
+ Useful flags:
98
+
99
+ | Flag | Effect |
100
+ | --- | --- |
101
+ | `--template next\|vite\|astro\|react-router` | Scaffold a new app during `init` |
102
+ | `--type component\|block` | Narrow `list`, `add`, and `update` |
103
+ | `--api-url <url>` | Point at a different Wensity origin, defaults to `https://ui.wensity.com` |
104
+ | `--force` | Allow `init` to overwrite an existing `wensity.json` |
105
+ | `--json` | Machine readable output where supported |
106
+
107
+ ## Authentication
108
+
109
+ Free components need no account. Wensity Pro components and blocks require an
110
+ API token from the [dashboard](https://ui.wensity.com/dashboard).
111
+
112
+ ```bash
113
+ npx wensity@latest login
114
+ npx wensity@latest whoami
115
+ ```
116
+
117
+ The token is written to `~/.config/wensity/credentials.json` with `0600`
118
+ permissions. The location honours `XDG_CONFIG_HOME`, and can be overridden with
119
+ `WENSITY_CONFIG_HOME` or `WENSITY_CREDENTIALS_FILE`. Access is checked server
120
+ side on every request, so the token is the only secret involved and it never
121
+ leaves your machine except as a bearer header to the Wensity API.
122
+
123
+ Run `wensity logout` to delete it.
124
+
125
+ ## Wensity CLI or the shadcn CLI
126
+
127
+ Free Wensity components are published to a public shadcn registry, so you can
128
+ install them with either tool. Use whichever fits your project.
129
+
130
+ | | Wensity CLI | shadcn CLI with `@wensity/*` |
131
+ | --- | --- | --- |
59
132
  | Full editable source | Yes | Yes |
60
- | `@wensity/ui` runtime | Never | Never |
61
- | Premium `/components` | Token + license | Not exported |
133
+ | `@wensity/ui` runtime dependency | Never | Never |
134
+ | Stored presets and `wensity.json` style | Yes | No |
135
+ | Lucide delivery | Yes, via icon transform | No, payloads are Tabler canonical |
136
+ | Project scaffolding (`--template`) | Yes | No |
137
+ | Wensity Pro components | Yes, with a token | Not published |
138
+
139
+ The public registry lives at [wensity/registry](https://github.com/wensity/registry):
140
+
141
+ ```bash
142
+ npx shadcn@latest add @wensity/button
143
+ ```
144
+
145
+ ## Configuration
146
+
147
+ `wensity.json` sits at your project root, next to `package.json`. The CLI
148
+ looks for it from the current directory upward and stops at the first
149
+ `package.json`, so a `wensity.json` belonging to a parent folder is never used.
150
+ It never treats your home directory as a project. Without a `wensity.json`, the
151
+ default paths follow the `@/*` alias in `tsconfig.json`: `./*` puts components in
152
+ `components/wensity`, and `./src/*` puts them in `src/components/wensity`.
153
+
154
+ ```json
155
+ {
156
+ "$schema": "https://ui.wensity.com/schema/wensity.json",
157
+ "version": 1,
158
+ "registry": "https://ui.wensity.com/api/registry",
159
+ "components": "src/components/wensity",
160
+ "utils": "src/lib/utils",
161
+ "tailwind": {
162
+ "config": "tailwind.config.ts",
163
+ "css": "src/app/globals.css"
164
+ },
165
+ "aliases": {
166
+ "components": "@/components/wensity",
167
+ "utils": "@/lib/utils"
168
+ },
169
+ "style": {
170
+ "iconLibrary": "tabler",
171
+ "radius": "medium"
172
+ }
173
+ }
174
+ ```
175
+
176
+ `init` also records a `style` block with fonts and control colors, which is
177
+ what `--preset` overwrites. Paths and aliases are read on every `add` and
178
+ `update`, so you can relocate the components directory and the CLI follows.
179
+
180
+ ## Source and issues
181
+
182
+ The CLI is open source at [wensity/cli](https://github.com/wensity/cli), MIT
183
+ licensed. Issues and pull requests are welcome there.
184
+
185
+ For a bug in a component's source rather than the CLI itself, open an issue on
186
+ [wensity/registry](https://github.com/wensity/registry) instead.
187
+
188
+ ## License
189
+
190
+ MIT. See [LICENSE](./LICENSE).
62
191
 
63
- Docs: [CLI reference](https://ui.wensity.com/docs/cli) · [Create preset](https://ui.wensity.com/docs/create-preset) · [Primitives](https://ui.wensity.com/docs/primitives)
192
+ Copyright (c) 2026 Wensity Private Limited.