tokvista 1.12.1 → 1.14.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.
- package/README.md +107 -74
- package/dist/cli/browser.js +17 -16
- package/dist/index.cjs +10 -9
- package/dist/index.d.cts +2 -3
- package/dist/index.d.ts +2 -3
- package/dist/index.js +10 -9
- package/dist/styles.css +545 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -19,10 +19,16 @@ Zero configuration. Multiple formats. One command.
|
|
|
19
19
|
## Features
|
|
20
20
|
|
|
21
21
|
- 🎨 **Beautiful visuals** - Colors, spacing, typography, and components
|
|
22
|
+
- 📊 **Pre-ship checklist** - Analytics tab catches broken aliases, hardcoded values, and architecture issues before you publish
|
|
22
23
|
- 🔄 **Multi-format support** - Token Studio, W3C, Style Dictionary, Supernova, Figma API
|
|
23
24
|
- 📋 **Smart copy** - CSS Variables, SCSS, or Tailwind with one click
|
|
24
25
|
- 🔍 **Instant search** - `Cmd+K` / `Ctrl+K` to find any token
|
|
25
|
-
-
|
|
26
|
+
- 🔗 **Deep linking** - Share direct URLs to specific tokens
|
|
27
|
+
- 🔬 **Token scanner** - Find unused tokens and hardcoded values
|
|
28
|
+
- ✅ **Validation** - Check token structure and catch errors
|
|
29
|
+
- 🔄 **Format conversion** - Convert between token formats
|
|
30
|
+
- 📤 **Export** - Generate CSS, SCSS, JS, or Tailwind config
|
|
31
|
+
- 🎯 **Zero config** - Works out of the box
|
|
26
32
|
- ⚡ **Two modes** - CLI for quick preview or React component for apps
|
|
27
33
|
- 🔥 **Live reload** - Auto-refresh on file changes
|
|
28
34
|
|
|
@@ -72,139 +78,159 @@ No configuration needed - just pass your tokens.
|
|
|
72
78
|
|
|
73
79
|
---
|
|
74
80
|
|
|
75
|
-
## CLI
|
|
81
|
+
## CLI Commands
|
|
76
82
|
|
|
77
|
-
###
|
|
83
|
+
### Preview & Documentation
|
|
78
84
|
|
|
79
85
|
```bash
|
|
80
|
-
#
|
|
81
|
-
npx tokvista
|
|
82
|
-
|
|
83
|
-
# Specify token file
|
|
84
|
-
npx tokvista ./design-tokens.json
|
|
86
|
+
# Start interactive documentation
|
|
87
|
+
npx tokvista tokens.json
|
|
85
88
|
|
|
86
89
|
# Custom port
|
|
87
90
|
npx tokvista tokens.json --port 4000
|
|
88
91
|
|
|
89
92
|
# Don't open browser
|
|
90
93
|
npx tokvista tokens.json --no-open
|
|
94
|
+
|
|
95
|
+
# Disable live reload
|
|
96
|
+
npx tokvista tokens.json --no-watch
|
|
91
97
|
```
|
|
92
98
|
|
|
93
|
-
###
|
|
99
|
+
### Setup & Configuration
|
|
94
100
|
|
|
95
101
|
```bash
|
|
96
|
-
#
|
|
97
|
-
npx tokvista
|
|
102
|
+
# Interactive setup wizard
|
|
103
|
+
npx tokvista init
|
|
98
104
|
|
|
99
|
-
#
|
|
100
|
-
npx tokvista
|
|
105
|
+
# Force overwrite existing config
|
|
106
|
+
npx tokvista init --force
|
|
101
107
|
|
|
102
|
-
#
|
|
103
|
-
npx tokvista
|
|
108
|
+
# Skip preview after setup
|
|
109
|
+
npx tokvista init --no-preview
|
|
110
|
+
```
|
|
104
111
|
|
|
105
|
-
|
|
106
|
-
npx tokvista export tokens.json --format tailwind --output tailwind.config.js
|
|
112
|
+
### Scan & Analyze
|
|
107
113
|
|
|
108
|
-
|
|
109
|
-
|
|
114
|
+
```bash
|
|
115
|
+
# Scan for token usage and issues
|
|
116
|
+
npx tokvista scan tokens.json
|
|
117
|
+
|
|
118
|
+
# Scan specific directory
|
|
119
|
+
npx tokvista scan ./src --tokens tokens.json
|
|
120
|
+
|
|
121
|
+
# Finds:
|
|
122
|
+
# - Unused tokens (safe to remove)
|
|
123
|
+
# - Hardcoded colors that should use tokens
|
|
124
|
+
# - Hardcoded spacing values
|
|
125
|
+
# - Semantic tokens with hardcoded values
|
|
110
126
|
```
|
|
111
127
|
|
|
112
|
-
### Validate
|
|
128
|
+
### Validate & Quality
|
|
113
129
|
|
|
114
130
|
```bash
|
|
115
|
-
#
|
|
131
|
+
# Validate token structure
|
|
116
132
|
npx tokvista validate tokens.json
|
|
117
133
|
|
|
118
|
-
#
|
|
119
|
-
|
|
134
|
+
# Checks for:
|
|
135
|
+
# - Invalid color values
|
|
136
|
+
# - Invalid dimension values
|
|
137
|
+
# - Broken token aliases
|
|
138
|
+
# - Missing type fields
|
|
139
|
+
# Exit code 1 on errors (perfect for CI/CD)
|
|
120
140
|
```
|
|
121
141
|
|
|
122
|
-
### Compare
|
|
142
|
+
### Compare & Diff
|
|
123
143
|
|
|
124
144
|
```bash
|
|
125
145
|
# Compare two token files
|
|
126
146
|
npx tokvista diff tokens-v1.json tokens-v2.json
|
|
127
147
|
|
|
128
|
-
#
|
|
129
|
-
# -
|
|
130
|
-
# -
|
|
131
|
-
# -
|
|
148
|
+
# Shows:
|
|
149
|
+
# - Added tokens
|
|
150
|
+
# - Removed tokens
|
|
151
|
+
# - Modified tokens with old/new values
|
|
152
|
+
# - Unchanged count
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
### Export & Generate
|
|
156
|
+
|
|
157
|
+
```bash
|
|
158
|
+
# Export to CSS
|
|
159
|
+
npx tokvista export tokens.json --format css --output tokens.css
|
|
160
|
+
|
|
161
|
+
# Export to SCSS
|
|
162
|
+
npx tokvista export tokens.json --format scss --output _tokens.scss
|
|
163
|
+
|
|
164
|
+
# Export to JavaScript
|
|
165
|
+
npx tokvista export tokens.json --format json --output tokens.js
|
|
166
|
+
|
|
167
|
+
# Export to Tailwind
|
|
168
|
+
npx tokvista export tokens.json --format tailwind --output tailwind.config.js
|
|
169
|
+
|
|
170
|
+
# Print to stdout (for piping)
|
|
171
|
+
npx tokvista export tokens.json --format css
|
|
132
172
|
```
|
|
133
173
|
|
|
134
174
|
### Convert Formats
|
|
135
175
|
|
|
136
176
|
```bash
|
|
137
|
-
# Convert to W3C DTCG
|
|
177
|
+
# Convert to W3C DTCG
|
|
138
178
|
npx tokvista convert tokens.json --to w3c --output tokens-w3c.json
|
|
139
179
|
|
|
140
180
|
# Convert to Style Dictionary
|
|
141
181
|
npx tokvista convert tokens.json --to style-dictionary --output tokens-sd.json
|
|
142
182
|
|
|
143
|
-
# Convert to Supernova
|
|
183
|
+
# Convert to Supernova
|
|
144
184
|
npx tokvista convert tokens.json --to supernova --output tokens-sn.json
|
|
145
185
|
|
|
146
|
-
#
|
|
147
|
-
npx tokvista convert tokens.json --to
|
|
186
|
+
# Convert to Token Studio
|
|
187
|
+
npx tokvista convert tokens.json --to token-studio --output tokens-ts.json
|
|
148
188
|
```
|
|
149
189
|
|
|
150
|
-
### Build
|
|
190
|
+
### Build Pipeline
|
|
151
191
|
|
|
152
192
|
```bash
|
|
153
|
-
# Build
|
|
193
|
+
# Build all formats at once
|
|
154
194
|
npx tokvista build tokens.json --output-dir ./dist
|
|
155
195
|
|
|
156
196
|
# Creates:
|
|
157
|
-
# - tokens.css
|
|
158
|
-
# - tokens.scss
|
|
159
|
-
# - tokens.js
|
|
160
|
-
# - tailwind.config.js
|
|
197
|
+
# - tokens.css (CSS Variables)
|
|
198
|
+
# - tokens.scss (SCSS Variables)
|
|
199
|
+
# - tokens.js (JavaScript/TypeScript)
|
|
200
|
+
# - tailwind.config.js (Tailwind Config)
|
|
161
201
|
|
|
162
202
|
# Skip validation for faster builds
|
|
163
203
|
npx tokvista build tokens.json --output-dir ./dist --skip-validation
|
|
164
204
|
```
|
|
165
205
|
|
|
166
|
-
###
|
|
206
|
+
### CLI Options Reference
|
|
167
207
|
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
export
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
logo: './logo.svg',
|
|
179
|
-
tokens: './tokens.json',
|
|
180
|
-
theme: 'system',
|
|
181
|
-
brandColor: '#6366f1',
|
|
182
|
-
categories: ['foundation', 'semantic', 'components'],
|
|
183
|
-
}
|
|
184
|
-
```
|
|
185
|
-
|
|
186
|
-
Then run `npx tokvista` to use your config.
|
|
187
|
-
|
|
188
|
-
### CLI Options
|
|
208
|
+
| Command | Description |
|
|
209
|
+
|---------|-------------|
|
|
210
|
+
| `tokvista [file]` | Start documentation server |
|
|
211
|
+
| `tokvista init` | Interactive configuration setup |
|
|
212
|
+
| `tokvista scan <dir\|file>` | Analyze token usage and find issues |
|
|
213
|
+
| `tokvista validate <file>` | Validate token structure |
|
|
214
|
+
| `tokvista diff <old> <new>` | Compare two token files |
|
|
215
|
+
| `tokvista export <file>` | Export tokens to various formats |
|
|
216
|
+
| `tokvista convert <file>` | Convert between token formats |
|
|
217
|
+
| `tokvista build <file>` | Build all formats (validate + export) |
|
|
189
218
|
|
|
190
219
|
| Option | Description |
|
|
191
220
|
|--------|-------------|
|
|
192
|
-
|
|
|
193
|
-
|
|
|
194
|
-
| `
|
|
195
|
-
| `
|
|
196
|
-
| `
|
|
197
|
-
| `
|
|
198
|
-
| `
|
|
199
|
-
| `--
|
|
200
|
-
| `--port`, `-p` | Server port (default: `3000`) |
|
|
201
|
-
| `--format` | Export format (export only) |
|
|
202
|
-
| `--output`, `-o` | Output file path (export only) |
|
|
203
|
-
| `--no-open` | Don't open browser |
|
|
221
|
+
| `--config`, `-c` | Path to config file |
|
|
222
|
+
| `--port`, `-p` | Server port (default: 3000) |
|
|
223
|
+
| `--format` | Export format: css, scss, json, tailwind |
|
|
224
|
+
| `--output`, `-o` | Output file path |
|
|
225
|
+
| `--output-dir` | Output directory for build command |
|
|
226
|
+
| `--to` | Target format for convert command |
|
|
227
|
+
| `--tokens` | Token file path for scan command |
|
|
228
|
+
| `--no-open` | Don't open browser automatically |
|
|
204
229
|
| `--no-watch` | Disable live reload |
|
|
205
230
|
| `--no-preview` | Skip preview after init |
|
|
206
|
-
| `--
|
|
207
|
-
| `--
|
|
231
|
+
| `--skip-validation` | Skip validation in build command |
|
|
232
|
+
| `--force`, `-f` | Overwrite existing files |
|
|
233
|
+
| `--help`, `-h` | Show help message |
|
|
208
234
|
|
|
209
235
|
---
|
|
210
236
|
|
|
@@ -327,6 +353,13 @@ See [GUIDE.md](./GUIDE.md) for complete setup instructions.
|
|
|
327
353
|
- Keyboard navigation
|
|
328
354
|
- Click result to copy
|
|
329
355
|
|
|
356
|
+
### 🔗 Deep Linking
|
|
357
|
+
|
|
358
|
+
- Share direct links to tokens
|
|
359
|
+
- URL updates when clicking tokens
|
|
360
|
+
- Auto-scroll and highlight on page load
|
|
361
|
+
- Example: `https://yoursite.com/tokens#color-primary-500`
|
|
362
|
+
|
|
330
363
|
### 📤 Code Export
|
|
331
364
|
|
|
332
365
|
Export all tokens as:
|