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