intentcss-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.
- package/LICENSE +21 -0
- package/README.md +21 -0
- package/dist/bin/intent.d.ts +8 -0
- package/dist/bin/intent.d.ts.map +1 -0
- package/dist/bin/intent.js +55 -0
- package/dist/bin/intent.js.map +1 -0
- package/dist/commands/compile.d.ts +14 -0
- package/dist/commands/compile.d.ts.map +1 -0
- package/dist/commands/compile.js +103 -0
- package/dist/commands/compile.js.map +1 -0
- package/dist/commands/generate.d.ts +14 -0
- package/dist/commands/generate.d.ts.map +1 -0
- package/dist/commands/generate.js +127 -0
- package/dist/commands/generate.js.map +1 -0
- package/dist/commands/init.d.ts +12 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +398 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/migrate.d.ts +13 -0
- package/dist/commands/migrate.d.ts.map +1 -0
- package/dist/commands/migrate.js +155 -0
- package/dist/commands/migrate.js.map +1 -0
- package/dist/commands/validate.d.ts +13 -0
- package/dist/commands/validate.d.ts.map +1 -0
- package/dist/commands/validate.js +109 -0
- package/dist/commands/validate.js.map +1 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +14 -0
- package/dist/index.js.map +1 -0
- package/dist/utils/config.d.ts +9 -0
- package/dist/utils/config.d.ts.map +1 -0
- package/dist/utils/config.js +46 -0
- package/dist/utils/config.js.map +1 -0
- package/dist/utils/diagnostics.d.ts +7 -0
- package/dist/utils/diagnostics.d.ts.map +1 -0
- package/dist/utils/diagnostics.js +9 -0
- package/dist/utils/diagnostics.js.map +1 -0
- package/package.json +56 -0
|
@@ -0,0 +1,398 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Init Command
|
|
3
|
+
*
|
|
4
|
+
* Initializes Intent in a new or existing project.
|
|
5
|
+
*/
|
|
6
|
+
import fs from 'node:fs/promises';
|
|
7
|
+
import path from 'node:path';
|
|
8
|
+
import chalk from 'chalk';
|
|
9
|
+
const DEFAULT_CONFIG = `import { defineSystem, defineComponent, prop, when } from 'intent-core';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Intent Design System
|
|
13
|
+
*
|
|
14
|
+
* This configuration defines a complete design system
|
|
15
|
+
* with semantic tokens and constrained component definitions.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
export default defineSystem({
|
|
19
|
+
name: 'MyDesignSystem',
|
|
20
|
+
|
|
21
|
+
tokens: {
|
|
22
|
+
// Semantic colors - AI never uses hex codes directly
|
|
23
|
+
color: {
|
|
24
|
+
// Brand
|
|
25
|
+
'brand-primary': '#6366F1',
|
|
26
|
+
'brand-primary-hover': '#4F46E5',
|
|
27
|
+
'brand-secondary': '#8B5CF6',
|
|
28
|
+
|
|
29
|
+
// Feedback
|
|
30
|
+
'feedback-success': '#10B981',
|
|
31
|
+
'feedback-warning': '#F59E0B',
|
|
32
|
+
'feedback-error': '#EF4444',
|
|
33
|
+
'feedback-info': '#3B82F6',
|
|
34
|
+
|
|
35
|
+
// Surfaces
|
|
36
|
+
'surface-default': '#FFFFFF',
|
|
37
|
+
'surface-elevated': '#FFFFFF',
|
|
38
|
+
'surface-subtle': '#F8FAFC',
|
|
39
|
+
'surface-inverse': '#1E293B',
|
|
40
|
+
|
|
41
|
+
// Text
|
|
42
|
+
'text-default': '#0F172A',
|
|
43
|
+
'text-subtle': '#64748B',
|
|
44
|
+
'text-inverse': '#FFFFFF',
|
|
45
|
+
'text-muted': '#94A3B8',
|
|
46
|
+
|
|
47
|
+
// Borders
|
|
48
|
+
'border-default': '#E2E8F0',
|
|
49
|
+
'border-subtle': '#F1F5F9',
|
|
50
|
+
},
|
|
51
|
+
|
|
52
|
+
// Spacing scale - named for semantic meaning
|
|
53
|
+
space: {
|
|
54
|
+
'none': '0',
|
|
55
|
+
'tight': '4px',
|
|
56
|
+
'compact': '8px',
|
|
57
|
+
'normal': '12px',
|
|
58
|
+
'relaxed': '16px',
|
|
59
|
+
'loose': '24px',
|
|
60
|
+
'xl': '32px',
|
|
61
|
+
'xxl': '48px',
|
|
62
|
+
'xxxl': '64px',
|
|
63
|
+
},
|
|
64
|
+
|
|
65
|
+
// Elevation system
|
|
66
|
+
elevation: {
|
|
67
|
+
'none': '0',
|
|
68
|
+
'low': '0 1px 3px rgba(0,0,0,0.08)',
|
|
69
|
+
'medium': '0 4px 6px rgba(0,0,0,0.05), 0 2px 4px rgba(0,0,0,0.03)',
|
|
70
|
+
'high': '0 10px 15px rgba(0,0,0,0.05), 0 4px 6px rgba(0,0,0,0.02)',
|
|
71
|
+
'highest': '0 20px 25px rgba(0,0,0,0.1), 0 10px 10px rgba(0,0,0,0.04)',
|
|
72
|
+
},
|
|
73
|
+
|
|
74
|
+
// Border radius
|
|
75
|
+
radius: {
|
|
76
|
+
'none': '0',
|
|
77
|
+
'sm': '4px',
|
|
78
|
+
'md': '8px',
|
|
79
|
+
'lg': '12px',
|
|
80
|
+
'xl': '16px',
|
|
81
|
+
'full': '9999px',
|
|
82
|
+
},
|
|
83
|
+
|
|
84
|
+
// Typography scale
|
|
85
|
+
typography: {
|
|
86
|
+
'font-sans': 'system-ui, -apple-system, sans-serif',
|
|
87
|
+
'font-mono': 'ui-monospace, monospace',
|
|
88
|
+
|
|
89
|
+
'size-xs': '12px',
|
|
90
|
+
'size-sm': '14px',
|
|
91
|
+
'size-md': '16px',
|
|
92
|
+
'size-lg': '18px',
|
|
93
|
+
'size-xl': '20px',
|
|
94
|
+
'size-2xl': '24px',
|
|
95
|
+
'size-3xl': '30px',
|
|
96
|
+
'size-4xl': '36px',
|
|
97
|
+
|
|
98
|
+
'weight-normal': '400',
|
|
99
|
+
'weight-medium': '500',
|
|
100
|
+
'weight-semibold': '600',
|
|
101
|
+
'weight-bold': '700',
|
|
102
|
+
|
|
103
|
+
'leading-tight': '1.25',
|
|
104
|
+
'leading-normal': '1.5',
|
|
105
|
+
'leading-relaxed': '1.75',
|
|
106
|
+
},
|
|
107
|
+
},
|
|
108
|
+
|
|
109
|
+
components: {
|
|
110
|
+
Button: defineComponent({
|
|
111
|
+
name: 'Button',
|
|
112
|
+
description: 'Interactive element that triggers an action when clicked',
|
|
113
|
+
properties: {
|
|
114
|
+
importance: prop.enum(['primary', 'secondary', 'ghost', 'danger'], { required: true }),
|
|
115
|
+
size: prop.enum(['sm', 'md', 'lg'], { default: 'md' }),
|
|
116
|
+
state: prop.enum(['default', 'hover', 'active', 'disabled'], { default: 'default' }),
|
|
117
|
+
},
|
|
118
|
+
constraints: [
|
|
119
|
+
// Ghost buttons cannot be disabled - no visual distinction possible
|
|
120
|
+
when({ importance: 'ghost' }).forbid(['state'],
|
|
121
|
+
'Ghost buttons cannot have a disabled state'),
|
|
122
|
+
// Danger buttons require larger sizes for accessibility
|
|
123
|
+
when({ importance: 'danger' }).require({ size: ['md', 'lg'] },
|
|
124
|
+
'Danger actions require larger touch targets'),
|
|
125
|
+
],
|
|
126
|
+
mappings: {
|
|
127
|
+
// Visual mapping by importance
|
|
128
|
+
'importance=primary': {
|
|
129
|
+
background: 'brand-primary',
|
|
130
|
+
color: 'text-inverse',
|
|
131
|
+
border: 'none',
|
|
132
|
+
},
|
|
133
|
+
'importance=secondary': {
|
|
134
|
+
background: 'transparent',
|
|
135
|
+
color: 'brand-primary',
|
|
136
|
+
border: '1px solid border-default',
|
|
137
|
+
},
|
|
138
|
+
'importance=ghost': {
|
|
139
|
+
background: 'transparent',
|
|
140
|
+
color: 'brand-primary',
|
|
141
|
+
border: 'none',
|
|
142
|
+
},
|
|
143
|
+
'importance=danger': {
|
|
144
|
+
background: 'feedback-error',
|
|
145
|
+
color: 'text-inverse',
|
|
146
|
+
border: 'none',
|
|
147
|
+
},
|
|
148
|
+
// Size mappings
|
|
149
|
+
'size=sm': {
|
|
150
|
+
padding: { sm: 'tight compact', md: 'compact normal', lg: 'normal relaxed' },
|
|
151
|
+
fontSize: 'size-sm',
|
|
152
|
+
},
|
|
153
|
+
'size=md': {
|
|
154
|
+
padding: { sm: 'compact normal', md: 'normal relaxed', lg: 'relaxed loose' },
|
|
155
|
+
fontSize: 'size-md',
|
|
156
|
+
},
|
|
157
|
+
'size=lg': {
|
|
158
|
+
padding: { sm: 'normal relaxed', md: 'relaxed loose', lg: 'loose xl' },
|
|
159
|
+
fontSize: 'size-lg',
|
|
160
|
+
},
|
|
161
|
+
},
|
|
162
|
+
baseStyles: {
|
|
163
|
+
display: 'inline-flex',
|
|
164
|
+
alignItems: 'center',
|
|
165
|
+
justifyContent: 'center',
|
|
166
|
+
fontWeight: 'weight-medium',
|
|
167
|
+
borderRadius: 'radius-md',
|
|
168
|
+
cursor: 'pointer',
|
|
169
|
+
transition: 'all 0.15s ease',
|
|
170
|
+
whiteSpace: 'nowrap',
|
|
171
|
+
},
|
|
172
|
+
}),
|
|
173
|
+
|
|
174
|
+
Stack: defineComponent({
|
|
175
|
+
name: 'Stack',
|
|
176
|
+
description: 'Layout component for distributing children along an axis',
|
|
177
|
+
properties: {
|
|
178
|
+
direction: prop.enum(['row', 'column'], { default: 'column' }),
|
|
179
|
+
gap: prop.enum(['none', 'tight', 'compact', 'normal', 'relaxed', 'loose'], { default: 'normal' }),
|
|
180
|
+
align: prop.enum(['start', 'center', 'end', 'stretch'], { default: 'stretch' }),
|
|
181
|
+
justify: prop.enum(['start', 'center', 'end', 'between', 'around'], { default: 'start' }),
|
|
182
|
+
},
|
|
183
|
+
constraints: [],
|
|
184
|
+
mappings: {
|
|
185
|
+
'direction=row': { flexDirection: 'row' },
|
|
186
|
+
'direction=column': { flexDirection: 'column' },
|
|
187
|
+
'gap=none': { gap: 'none' },
|
|
188
|
+
'gap=tight': { gap: 'tight' },
|
|
189
|
+
'gap=compact': { gap: 'compact' },
|
|
190
|
+
'gap=normal': { gap: 'normal' },
|
|
191
|
+
'gap=relaxed': { gap: 'relaxed' },
|
|
192
|
+
'gap=loose': { gap: 'loose' },
|
|
193
|
+
'align=start': { alignItems: 'flex-start' },
|
|
194
|
+
'align=center': { alignItems: 'center' },
|
|
195
|
+
'align=end': { alignItems: 'flex-end' },
|
|
196
|
+
'align=stretch': { alignItems: 'stretch' },
|
|
197
|
+
'justify=start': { justifyContent: 'flex-start' },
|
|
198
|
+
'justify=center': { justifyContent: 'center' },
|
|
199
|
+
'justify=end': { justifyContent: 'flex-end' },
|
|
200
|
+
'justify=between': { justifyContent: 'space-between' },
|
|
201
|
+
'justify=around': { justifyContent: 'space-around' },
|
|
202
|
+
},
|
|
203
|
+
baseStyles: {
|
|
204
|
+
display: 'flex',
|
|
205
|
+
},
|
|
206
|
+
}),
|
|
207
|
+
|
|
208
|
+
Surface: defineComponent({
|
|
209
|
+
name: 'Surface',
|
|
210
|
+
description: 'Container providing visual elevation and background treatment',
|
|
211
|
+
properties: {
|
|
212
|
+
elevation: prop.enum(['none', 'low', 'medium', 'high'], { default: 'none' }),
|
|
213
|
+
padding: prop.enum(['none', 'tight', 'compact', 'normal', 'relaxed', 'loose'], { default: 'none' }),
|
|
214
|
+
background: prop.enum(['default', 'subtle', 'elevated', 'inverse'], { default: 'default' }),
|
|
215
|
+
radius: prop.enum(['none', 'sm', 'md', 'lg'], { default: 'none' }),
|
|
216
|
+
},
|
|
217
|
+
constraints: [
|
|
218
|
+
// Inverse background requires high elevation for contrast
|
|
219
|
+
when({ background: 'inverse' }).require({ elevation: ['medium', 'high'] },
|
|
220
|
+
'Inverse backgrounds need elevation for proper contrast'),
|
|
221
|
+
],
|
|
222
|
+
mappings: {
|
|
223
|
+
'elevation=none': { boxShadow: 'elevation-none' },
|
|
224
|
+
'elevation=low': { boxShadow: 'elevation-low' },
|
|
225
|
+
'elevation=medium': { boxShadow: 'elevation-medium' },
|
|
226
|
+
'elevation=high': { boxShadow: 'elevation-high' },
|
|
227
|
+
'padding=none': { padding: 'none' },
|
|
228
|
+
'padding=tight': { padding: 'tight' },
|
|
229
|
+
'padding=compact': { padding: 'compact' },
|
|
230
|
+
'padding=normal': { padding: 'normal' },
|
|
231
|
+
'padding=relaxed': { padding: 'relaxed' },
|
|
232
|
+
'padding=loose': { padding: 'loose' },
|
|
233
|
+
'background=default': { background: 'surface-default' },
|
|
234
|
+
'background=subtle': { background: 'surface-subtle' },
|
|
235
|
+
'background=elevated': { background: 'surface-elevated' },
|
|
236
|
+
'background=inverse': { background: 'surface-inverse' },
|
|
237
|
+
'radius=none': { borderRadius: 'radius-none' },
|
|
238
|
+
'radius=sm': { borderRadius: 'radius-sm' },
|
|
239
|
+
'radius=md': { borderRadius: 'radius-md' },
|
|
240
|
+
'radius=lg': { borderRadius: 'radius-lg' },
|
|
241
|
+
},
|
|
242
|
+
baseStyles: {
|
|
243
|
+
border: '1px solid border-default',
|
|
244
|
+
},
|
|
245
|
+
}),
|
|
246
|
+
|
|
247
|
+
Text: defineComponent({
|
|
248
|
+
name: 'Text',
|
|
249
|
+
description: 'Typography component for displaying text',
|
|
250
|
+
properties: {
|
|
251
|
+
size: prop.enum(['xs', 'sm', 'md', 'lg', 'xl', '2xl'], { default: 'md' }),
|
|
252
|
+
weight: prop.enum(['normal', 'medium', 'semibold', 'bold'], { default: 'normal' }),
|
|
253
|
+
color: prop.enum(['default', 'subtle', 'muted', 'inverse', 'brand'], { default: 'default' }),
|
|
254
|
+
align: prop.enum(['left', 'center', 'right'], { default: 'left' }),
|
|
255
|
+
},
|
|
256
|
+
constraints: [],
|
|
257
|
+
mappings: {
|
|
258
|
+
'size=xs': { fontSize: 'size-xs', lineHeight: 'leading-normal' },
|
|
259
|
+
'size=sm': { fontSize: 'size-sm', lineHeight: 'leading-normal' },
|
|
260
|
+
'size=md': { fontSize: 'size-md', lineHeight: 'leading-normal' },
|
|
261
|
+
'size=lg': { fontSize: 'size-lg', lineHeight: 'leading-relaxed' },
|
|
262
|
+
'size=xl': { fontSize: 'size-xl', lineHeight: 'leading-relaxed' },
|
|
263
|
+
'size=xxl': { fontSize: 'size-2xl', lineHeight: 'leading-tight' },
|
|
264
|
+
'weight=normal': { fontWeight: 'weight-normal' },
|
|
265
|
+
'weight=medium': { fontWeight: 'weight-medium' },
|
|
266
|
+
'weight=semibold': { fontWeight: 'weight-semibold' },
|
|
267
|
+
'weight=bold': { fontWeight: 'weight-bold' },
|
|
268
|
+
'color=default': { color: 'text-default' },
|
|
269
|
+
'color=subtle': { color: 'text-subtle' },
|
|
270
|
+
'color=muted': { color: 'text-muted' },
|
|
271
|
+
'color=inverse': { color: 'text-inverse' },
|
|
272
|
+
'color=brand': { color: 'brand-primary' },
|
|
273
|
+
},
|
|
274
|
+
baseStyles: {
|
|
275
|
+
fontFamily: 'font-sans',
|
|
276
|
+
margin: '0',
|
|
277
|
+
},
|
|
278
|
+
}),
|
|
279
|
+
|
|
280
|
+
Badge: defineComponent({
|
|
281
|
+
name: 'Badge',
|
|
282
|
+
description: 'Small label for displaying status, count, or category',
|
|
283
|
+
properties: {
|
|
284
|
+
importance: prop.enum(['default', 'primary', 'success', 'warning', 'error'], { default: 'default' }),
|
|
285
|
+
size: prop.enum(['sm', 'md'], { default: 'sm' }),
|
|
286
|
+
},
|
|
287
|
+
constraints: [],
|
|
288
|
+
mappings: {
|
|
289
|
+
'importance=default': { background: 'surface-subtle', color: 'text-subtle' },
|
|
290
|
+
'importance=primary': { background: 'brand-primary', color: 'text-inverse' },
|
|
291
|
+
'importance=success': { background: 'feedback-success', color: 'text-inverse' },
|
|
292
|
+
'importance=warning': { background: 'feedback-warning', color: 'text-inverse' },
|
|
293
|
+
'importance=error': { background: 'feedback-error', color: 'text-inverse' },
|
|
294
|
+
'size=sm': { padding: 'tight compact', fontSize: 'size-xs' },
|
|
295
|
+
'size=md': { padding: 'compact normal', fontSize: 'size-sm' },
|
|
296
|
+
},
|
|
297
|
+
baseStyles: {
|
|
298
|
+
display: 'inline-flex',
|
|
299
|
+
alignItems: 'center',
|
|
300
|
+
borderRadius: 'radius-full',
|
|
301
|
+
fontWeight: 'weight-medium',
|
|
302
|
+
},
|
|
303
|
+
}),
|
|
304
|
+
},
|
|
305
|
+
|
|
306
|
+
settings: {
|
|
307
|
+
cssPrefix: 'intent',
|
|
308
|
+
generateCSSVariables: true,
|
|
309
|
+
strictMode: true,
|
|
310
|
+
},
|
|
311
|
+
});
|
|
312
|
+
`;
|
|
313
|
+
const CSS_IMPORT_SNIPPET = `
|
|
314
|
+
/* Add to your main CSS file or _app.tsx/_layout.tsx */
|
|
315
|
+
@import '.intent/intent.css';
|
|
316
|
+
`;
|
|
317
|
+
export async function initCommand(options) {
|
|
318
|
+
console.log(chalk.blue('Intent'), chalk.gray('initializing...\n'));
|
|
319
|
+
const configPath = 'intent.config.ts';
|
|
320
|
+
// Check if config already exists
|
|
321
|
+
try {
|
|
322
|
+
await fs.access(configPath);
|
|
323
|
+
if (!options.force) {
|
|
324
|
+
console.log(chalk.yellow('⚠'), 'Config file already exists:', configPath);
|
|
325
|
+
console.log(chalk.gray(' Use --force to overwrite'));
|
|
326
|
+
return;
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
catch {
|
|
330
|
+
// File doesn't exist, proceed
|
|
331
|
+
}
|
|
332
|
+
// Write config file
|
|
333
|
+
await fs.writeFile(configPath, DEFAULT_CONFIG);
|
|
334
|
+
console.log(chalk.green('✓'), 'Created', chalk.cyan(configPath));
|
|
335
|
+
// Create .gitignore entry
|
|
336
|
+
try {
|
|
337
|
+
let gitignore = '';
|
|
338
|
+
try {
|
|
339
|
+
gitignore = await fs.readFile('.gitignore', 'utf-8');
|
|
340
|
+
}
|
|
341
|
+
catch {
|
|
342
|
+
// .gitignore doesn't exist
|
|
343
|
+
}
|
|
344
|
+
if (!gitignore.includes('.intent/')) {
|
|
345
|
+
await fs.appendFile('.gitignore', '\n# Intent compiled output\n.intent/\n');
|
|
346
|
+
console.log(chalk.green('✓'), 'Updated', chalk.cyan('.gitignore'));
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
catch {
|
|
350
|
+
// Ignore errors
|
|
351
|
+
}
|
|
352
|
+
// Create example component
|
|
353
|
+
const exampleDir = 'components';
|
|
354
|
+
try {
|
|
355
|
+
await fs.mkdir(exampleDir, { recursive: true });
|
|
356
|
+
const exampleComponent = `import { Stack, Button } from 'intent-react';
|
|
357
|
+
|
|
358
|
+
export function Example() {
|
|
359
|
+
return (
|
|
360
|
+
<Stack direction="column" gap="relaxed">
|
|
361
|
+
<Stack direction="row" gap="normal">
|
|
362
|
+
<Button importance="primary" size="md">
|
|
363
|
+
Primary Action
|
|
364
|
+
</Button>
|
|
365
|
+
<Button importance="secondary" size="md">
|
|
366
|
+
Secondary
|
|
367
|
+
</Button>
|
|
368
|
+
</Stack>
|
|
369
|
+
|
|
370
|
+
<Stack direction="row" gap="normal">
|
|
371
|
+
<Button importance="ghost" size="sm">
|
|
372
|
+
Ghost Button
|
|
373
|
+
</Button>
|
|
374
|
+
<Button importance="danger" size="md">
|
|
375
|
+
Danger Action
|
|
376
|
+
</Button>
|
|
377
|
+
</Stack>
|
|
378
|
+
</Stack>
|
|
379
|
+
);
|
|
380
|
+
}
|
|
381
|
+
`;
|
|
382
|
+
await fs.writeFile(path.join(exampleDir, 'Example.tsx'), exampleComponent);
|
|
383
|
+
console.log(chalk.green('✓'), 'Created example component:', chalk.cyan('components/Example.tsx'));
|
|
384
|
+
}
|
|
385
|
+
catch {
|
|
386
|
+
// Ignore errors
|
|
387
|
+
}
|
|
388
|
+
console.log();
|
|
389
|
+
console.log(chalk.green('Intent initialized successfully!'));
|
|
390
|
+
console.log();
|
|
391
|
+
console.log('Next steps:');
|
|
392
|
+
console.log(' 1.', chalk.cyan('npm install intent-react'));
|
|
393
|
+
console.log(' 2.', chalk.cyan('intent compile'), 'to generate CSS');
|
|
394
|
+
console.log(' 3.', chalk.cyan('intent validate'), 'to check your components');
|
|
395
|
+
console.log();
|
|
396
|
+
console.log(chalk.gray(CSS_IMPORT_SNIPPET));
|
|
397
|
+
}
|
|
398
|
+
//# sourceMappingURL=init.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"init.js","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CAAC,CAAC;IACpG,CAAC;IAAC,MAAM,CAAC;QACP,gBAAgB;IAClB,CAAC;IAED,OAAO,CAAC,GAAG,EAAE,CAAC;IACd,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,kCAAkC,CAAC,CAAC,CAAC;IAC7D,OAAO,CAAC,GAAG,EAAE,CAAC;IACd,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;IAC3B,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,IAAI,CAAC,0BAA0B,CAAC,CAAC,CAAC;IAC5D,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,IAAI,CAAC,gBAAgB,CAAC,EAAE,iBAAiB,CAAC,CAAC;IACrE,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,IAAI,CAAC,iBAAiB,CAAC,EAAE,0BAA0B,CAAC,CAAC;IAC/E,OAAO,CAAC,GAAG,EAAE,CAAC;IACd,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC,CAAC;AAC9C,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Migrate Command
|
|
3
|
+
*
|
|
4
|
+
* Migrates from existing styling solutions to Intent.
|
|
5
|
+
*/
|
|
6
|
+
interface MigrateOptions {
|
|
7
|
+
from: string;
|
|
8
|
+
src: string;
|
|
9
|
+
dryRun: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare function migrateCommand(options: MigrateOptions): Promise<void>;
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=migrate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"migrate.d.ts","sourceRoot":"","sources":["../../src/commands/migrate.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAOH,UAAU,cAAc;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,OAAO,CAAC;CACjB;AAgDD,wBAAsB,cAAc,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAiI3E"}
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Migrate Command
|
|
3
|
+
*
|
|
4
|
+
* Migrates from existing styling solutions to Intent.
|
|
5
|
+
*/
|
|
6
|
+
import fs from 'node:fs/promises';
|
|
7
|
+
import path from 'node:path';
|
|
8
|
+
import chalk from 'chalk';
|
|
9
|
+
import { globby } from 'globby';
|
|
10
|
+
// Common Tailwind to Intent mappings
|
|
11
|
+
const TAILWIND_MAPPINGS = {
|
|
12
|
+
// Layout
|
|
13
|
+
'flex': { component: 'Stack', props: { direction: 'row' } },
|
|
14
|
+
'flex-col': { component: 'Stack', props: { direction: 'column' } },
|
|
15
|
+
'items-center': { component: 'Stack', props: { align: 'center' } },
|
|
16
|
+
'items-start': { component: 'Stack', props: { align: 'start' } },
|
|
17
|
+
'items-end': { component: 'Stack', props: { align: 'end' } },
|
|
18
|
+
'justify-center': { component: 'Stack', props: { justify: 'center' } },
|
|
19
|
+
'justify-between': { component: 'Stack', props: { justify: 'between' } },
|
|
20
|
+
'gap-1': { component: 'Stack', props: { gap: 'tight' } },
|
|
21
|
+
'gap-2': { component: 'Stack', props: { gap: 'normal' } },
|
|
22
|
+
'gap-4': { component: 'Stack', props: { gap: 'relaxed' } },
|
|
23
|
+
'gap-8': { component: 'Stack', props: { gap: 'loose' } },
|
|
24
|
+
// Buttons (heuristic)
|
|
25
|
+
'bg-blue-500': { component: 'Button', props: { importance: 'primary' } },
|
|
26
|
+
'bg-red-500': { component: 'Button', props: { importance: 'danger' } },
|
|
27
|
+
'bg-transparent': { component: 'Button', props: { importance: 'ghost' } },
|
|
28
|
+
};
|
|
29
|
+
// Patterns to detect
|
|
30
|
+
const UTILITY_PATTERNS = [
|
|
31
|
+
{ pattern: /\bp-[0-9]+\b/, type: 'padding', message: 'Use Surface padding prop' },
|
|
32
|
+
{ pattern: /\bpx-[0-9]+\b/, type: 'padding-x', message: 'Use Surface padding prop' },
|
|
33
|
+
{ pattern: /\bpy-[0-9]+\b/, type: 'padding-y', message: 'Use Surface padding prop' },
|
|
34
|
+
{ pattern: /\bm-[0-9]+\b/, type: 'margin', message: 'Use Stack gap prop' },
|
|
35
|
+
{ pattern: /\bmy-[0-9]+\b/, type: 'margin-y', message: 'Use Stack gap prop' },
|
|
36
|
+
{ pattern: /\bmx-[0-9]+\b/, type: 'margin-x', message: 'Use Stack gap prop' },
|
|
37
|
+
{ pattern: /\bbg-[\w-]+\b/, type: 'background', message: 'Use Surface background prop' },
|
|
38
|
+
{ pattern: /\btext-[\w-]+\b/, type: 'text', message: 'Use Text color/size prop' },
|
|
39
|
+
{ pattern: /\brounded-[\w-]+\b/, type: 'radius', message: 'Use Surface radius prop' },
|
|
40
|
+
{ pattern: /\bshadow-[\w-]+\b/, type: 'shadow', message: 'Use Surface elevation prop' },
|
|
41
|
+
{ pattern: /\bfont-[\w-]+\b/, type: 'font', message: 'Use Text weight prop' },
|
|
42
|
+
{ pattern: /\[.*?\]/, type: 'arbitrary', message: 'Arbitrary values not allowed in Intent' },
|
|
43
|
+
];
|
|
44
|
+
export async function migrateCommand(options) {
|
|
45
|
+
console.log(chalk.blue('Intent'), chalk.gray(`migrating from ${options.from}...\n`));
|
|
46
|
+
if (options.from !== 'tailwind') {
|
|
47
|
+
console.log(chalk.red('Error:'), 'Only Tailwind migration is currently supported');
|
|
48
|
+
process.exit(1);
|
|
49
|
+
}
|
|
50
|
+
const files = await globby([path.join(options.src, '**/*.{tsx,jsx,vue,svelte}')], { absolute: true });
|
|
51
|
+
console.log(`Found ${chalk.cyan(files.length)} files to analyze\n`);
|
|
52
|
+
const issues = [];
|
|
53
|
+
for (const filePath of files) {
|
|
54
|
+
const content = await fs.readFile(filePath, 'utf-8');
|
|
55
|
+
const lines = content.split('\n');
|
|
56
|
+
for (let i = 0; i < lines.length; i++) {
|
|
57
|
+
const line = lines[i];
|
|
58
|
+
const lineNum = i + 1;
|
|
59
|
+
// Find className attributes
|
|
60
|
+
const classNameMatches = line.matchAll(/className=["']([^"']+)["']/g);
|
|
61
|
+
for (const match of classNameMatches) {
|
|
62
|
+
const classValue = match[1];
|
|
63
|
+
const column = (match.index || 0) + 1;
|
|
64
|
+
// Check for utility patterns
|
|
65
|
+
for (const { pattern, type, message } of UTILITY_PATTERNS) {
|
|
66
|
+
if (pattern.test(classValue)) {
|
|
67
|
+
// Find matching classes
|
|
68
|
+
const matches = classValue.match(pattern);
|
|
69
|
+
if (matches) {
|
|
70
|
+
issues.push({
|
|
71
|
+
file: filePath,
|
|
72
|
+
line: lineNum,
|
|
73
|
+
column,
|
|
74
|
+
original: matches[0],
|
|
75
|
+
suggestion: message,
|
|
76
|
+
type,
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
// Check for flex patterns that suggest Stack
|
|
82
|
+
if (/\bflex\b/.test(classValue) && /\bgap-/.test(classValue)) {
|
|
83
|
+
issues.push({
|
|
84
|
+
file: filePath,
|
|
85
|
+
line: lineNum,
|
|
86
|
+
column,
|
|
87
|
+
original: 'flex + gap-*',
|
|
88
|
+
suggestion: 'Replace with <Stack direction="row" gap="...">',
|
|
89
|
+
type: 'layout',
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
// Report findings
|
|
96
|
+
console.log(chalk.cyan('Migration Report'));
|
|
97
|
+
console.log(chalk.gray('─'.repeat(50)));
|
|
98
|
+
// Group by type
|
|
99
|
+
const byType = new Map();
|
|
100
|
+
for (const issue of issues) {
|
|
101
|
+
if (!byType.has(issue.type)) {
|
|
102
|
+
byType.set(issue.type, []);
|
|
103
|
+
}
|
|
104
|
+
byType.get(issue.type).push(issue);
|
|
105
|
+
}
|
|
106
|
+
for (const [type, typeIssues] of byType) {
|
|
107
|
+
console.log();
|
|
108
|
+
console.log(chalk.yellow(`${type} (${typeIssues.length} occurrences)`));
|
|
109
|
+
for (const issue of typeIssues.slice(0, 5)) {
|
|
110
|
+
const relativePath = path.relative(process.cwd(), issue.file);
|
|
111
|
+
console.log(` ${chalk.gray('→')} ${relativePath}:${issue.line}`);
|
|
112
|
+
console.log(` ${chalk.cyan(issue.original)} → ${issue.suggestion}`);
|
|
113
|
+
}
|
|
114
|
+
if (typeIssues.length > 5) {
|
|
115
|
+
console.log(` ${chalk.gray(`... and ${typeIssues.length - 5} more`)}`);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
console.log();
|
|
119
|
+
console.log(chalk.gray('─'.repeat(50)));
|
|
120
|
+
console.log(`Total issues found: ${chalk.cyan(issues.length)}`);
|
|
121
|
+
if (options.dryRun) {
|
|
122
|
+
console.log();
|
|
123
|
+
console.log(chalk.gray('(Dry run - no files were modified)'));
|
|
124
|
+
}
|
|
125
|
+
else {
|
|
126
|
+
console.log();
|
|
127
|
+
console.log(chalk.yellow('Auto-migration is not yet implemented.'));
|
|
128
|
+
console.log('Please review the suggestions above and update your code manually.');
|
|
129
|
+
console.log();
|
|
130
|
+
console.log('For help with specific components, run:');
|
|
131
|
+
console.log(` ${chalk.cyan('intent generate --component Button')}`);
|
|
132
|
+
}
|
|
133
|
+
// Generate initial config suggestion
|
|
134
|
+
console.log();
|
|
135
|
+
console.log(chalk.cyan('Suggested intent.config.ts'));
|
|
136
|
+
console.log(chalk.gray('─'.repeat(50)));
|
|
137
|
+
console.log();
|
|
138
|
+
// Analyze discovered tokens
|
|
139
|
+
const discoveredColors = new Set();
|
|
140
|
+
const discoveredSpacing = new Set();
|
|
141
|
+
for (const issue of issues) {
|
|
142
|
+
if (issue.type === 'background' && issue.original.startsWith('bg-')) {
|
|
143
|
+
discoveredColors.add(issue.original.replace('bg-', ''));
|
|
144
|
+
}
|
|
145
|
+
if (issue.type === 'padding' || issue.type === 'margin') {
|
|
146
|
+
const num = issue.original.match(/\d+/)?.[0];
|
|
147
|
+
if (num)
|
|
148
|
+
discoveredSpacing.add(num);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
console.log(chalk.gray('// Based on your existing Tailwind usage:'));
|
|
152
|
+
console.log(chalk.gray('// Colors found:'), [...discoveredColors].slice(0, 5).join(', ') || 'none');
|
|
153
|
+
console.log(chalk.gray('// Spacing found:'), [...discoveredSpacing].slice(0, 5).join(', ') || 'none');
|
|
154
|
+
}
|
|
155
|
+
//# sourceMappingURL=migrate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"migrate.js","sourceRoot":"","sources":["../../src/commands/migrate.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAQhC,qCAAqC;AACrC,MAAM,iBAAiB,GAAyE;IAC9F,SAAS;IACT,MAAM,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE;IAC3D,UAAU,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE;IAClE,cAAc,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE;IAClE,aAAa,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE;IAChE,WAAW,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE;IAC5D,gBAAgB,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,OAA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GAAG,CAAC,GAAG,CAAC,CAAC;QACtC,CAAC;IACH,CAAC;IAED,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,2CAA2C,CAAC,CAAC,CAAC;IACrE,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,kBAAkB,CAAC,EAAE,CAAC,GAAG,gBAAgB,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,MAAM,CAAC,CAAC;IACpG,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,mBAAmB,CAAC,EAAE,CAAC,GAAG,iBAAiB,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,MAAM,CAAC,CAAC;AACxG,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Validate Command
|
|
3
|
+
*
|
|
4
|
+
* Validates component usage against the design system schema.
|
|
5
|
+
*/
|
|
6
|
+
interface ValidateOptions {
|
|
7
|
+
config: string;
|
|
8
|
+
fix: boolean;
|
|
9
|
+
strict: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare function validateCommand(files: string[], options: ValidateOptions): Promise<void>;
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=validate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../src/commands/validate.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AASH,UAAU,eAAe;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,OAAO,CAAC;IACb,MAAM,EAAE,OAAO,CAAC;CACjB;AAED,wBAAsB,eAAe,CACnC,KAAK,EAAE,MAAM,EAAE,EACf,OAAO,EAAE,eAAe,GACvB,OAAO,CAAC,IAAI,CAAC,CA4Hf"}
|