@su-record/vibe 2.8.3 → 2.8.4
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/commands/vibe.figma.md +62 -29
- package/package.json +1 -1
package/commands/vibe.figma.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
description: Figma design to code — extract + generate in one step
|
|
3
|
-
argument-hint: "figma-url" ["figma-url-2"] [--
|
|
3
|
+
argument-hint: "figma-url" ["figma-url-2"] [--new] [--component Name]
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# /vibe.figma
|
|
@@ -12,7 +12,7 @@ Extract Figma design data and generate production-ready component code, tailored
|
|
|
12
12
|
```
|
|
13
13
|
/vibe.figma "url" # Single design → project integrated (default)
|
|
14
14
|
/vibe.figma "mobile-url" "desktop-url" # Responsive — auto-detect viewport from frame width
|
|
15
|
-
/vibe.figma "url" --
|
|
15
|
+
/vibe.figma "url" --new # New feature — self-contained tokens, no existing design system dependency
|
|
16
16
|
/vibe.figma "url" --component LoginForm # Name the root component
|
|
17
17
|
/vibe.figma --local # Skip extraction, use existing figma-output/
|
|
18
18
|
```
|
|
@@ -22,7 +22,7 @@ Extract Figma design data and generate production-ready component code, tailored
|
|
|
22
22
|
| Flag | Behavior |
|
|
23
23
|
|------|----------|
|
|
24
24
|
| _(default)_ | **Project integration.** Use project's design system, existing tokens, component patterns. Place files in project's component directory. |
|
|
25
|
-
| `--
|
|
25
|
+
| `--new` | **New feature.** Self-contained tokens + components in project structure. No dependency on existing design system. Portable across projects. |
|
|
26
26
|
| _(multi URL)_ | **Responsive mode.** Auto-detected when 2+ URLs provided. Compares designs across viewports and generates responsive code with fluid scaling. |
|
|
27
27
|
|
|
28
28
|
### Responsive Mode
|
|
@@ -305,11 +305,14 @@ Stored in `~/.vibe/config.json` → `figma.breakpoints`. Partial overrides merge
|
|
|
305
305
|
|
|
306
306
|
### 3-4. Resolve Generation Mode
|
|
307
307
|
|
|
308
|
+
**Both modes use the project's existing directory structure.** Never create `figma-output/generated/`.
|
|
309
|
+
|
|
308
310
|
```
|
|
309
|
-
if --
|
|
310
|
-
→
|
|
311
|
-
→ generate self-contained
|
|
312
|
-
→ no
|
|
311
|
+
if --new flag:
|
|
312
|
+
→ detect project's page/component/style directories (same as default)
|
|
313
|
+
→ generate self-contained token file (no MASTER.md dependency)
|
|
314
|
+
→ components are self-contained (own tokens, no external design system imports)
|
|
315
|
+
→ placed in project's standard directories with feature-named subfolder
|
|
313
316
|
|
|
314
317
|
default (no flag):
|
|
315
318
|
→ scan existing component directories, theme files, token definitions
|
|
@@ -329,35 +332,65 @@ default (no flag):
|
|
|
329
332
|
2. **design-context.json tokens** — if `detectedStack.fonts`, `aesthetic.colorMood` exist, align with these
|
|
330
333
|
3. **New figma-tokens** — only for values that have no existing match
|
|
331
334
|
|
|
332
|
-
|
|
335
|
+
**--new mode**: Generate self-contained token file (no MASTER.md dependency), in project's standard directories.
|
|
336
|
+
|
|
337
|
+
#### Output Structure (both modes — project structure 준수)
|
|
338
|
+
|
|
339
|
+
프로젝트의 기존 디렉토리 구조를 감지하여 올바른 위치에 파일 생성.
|
|
333
340
|
|
|
334
|
-
|
|
341
|
+
**Step 1: 디렉토리 감지**
|
|
335
342
|
|
|
336
343
|
```
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
344
|
+
페이지 디렉토리:
|
|
345
|
+
Next.js → pages/ or app/
|
|
346
|
+
Nuxt → pages/
|
|
347
|
+
React → src/pages/ or src/views/
|
|
348
|
+
Vue → src/views/
|
|
349
|
+
|
|
350
|
+
컴포넌트 디렉토리:
|
|
351
|
+
Next.js → components/ or src/components/
|
|
352
|
+
Nuxt → components/
|
|
353
|
+
React → src/components/
|
|
354
|
+
Vue → src/components/
|
|
355
|
+
|
|
356
|
+
스타일 디렉토리:
|
|
357
|
+
SCSS → assets/scss/ or src/scss/ or src/styles/
|
|
358
|
+
CSS → src/styles/ or styles/
|
|
359
|
+
Tailwind → tailwind.config.* (extend)
|
|
348
360
|
```
|
|
349
361
|
|
|
350
|
-
|
|
362
|
+
**Step 2: 피처명 기반 폴더 생성**
|
|
363
|
+
|
|
364
|
+
`--component` 플래그 또는 Figma 파일명에서 피처명 추출 → kebab-case 변환.
|
|
351
365
|
|
|
352
366
|
```
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
367
|
+
예: Figma 파일명 "PUBG 9주년 이벤트" → pubg-anniversary
|
|
368
|
+
|
|
369
|
+
Nuxt 프로젝트:
|
|
370
|
+
pages/pubg-anniversary.vue ← 루트 페이지
|
|
371
|
+
components/pubg-anniversary/
|
|
372
|
+
HeroSection.vue ← 섹션 컴포넌트
|
|
373
|
+
EventSection.vue
|
|
374
|
+
RewardSection.vue
|
|
375
|
+
...
|
|
376
|
+
assets/scss/_pubg-anniversary-tokens.scss ← 피처별 토큰
|
|
377
|
+
|
|
378
|
+
React + Next.js 프로젝트:
|
|
379
|
+
app/pubg-anniversary/page.tsx ← 루트 페이지
|
|
380
|
+
components/pubg-anniversary/
|
|
381
|
+
HeroSection.tsx
|
|
382
|
+
HeroSection.module.css (or .module.scss)
|
|
383
|
+
EventSection.tsx
|
|
384
|
+
...
|
|
385
|
+
styles/pubg-anniversary-tokens.css ← 피처별 토큰
|
|
386
|
+
|
|
387
|
+
Default mode 차이점:
|
|
388
|
+
→ 토큰 파일에서 기존 MASTER.md / 프로젝트 토큰 참조
|
|
389
|
+
→ 새 토큰만 추가
|
|
358
390
|
|
|
359
|
-
|
|
360
|
-
|
|
391
|
+
--new mode 차이점:
|
|
392
|
+
→ 토큰 파일이 자체 완결 (외부 의존 없음)
|
|
393
|
+
→ 다른 프로젝트에 폴더째 복사 가능
|
|
361
394
|
```
|
|
362
395
|
|
|
363
396
|
### 4-2. Token File Format
|
|
@@ -1406,7 +1439,7 @@ After generating code, output a brief correction report:
|
|
|
1406
1439
|
## Correction Notes
|
|
1407
1440
|
|
|
1408
1441
|
### Generation Mode
|
|
1409
|
-
- Mode: default / --
|
|
1442
|
+
- Mode: default / --new / responsive
|
|
1410
1443
|
- Output directory: {path}
|
|
1411
1444
|
- Viewports: {list of viewport labels + widths, if responsive}
|
|
1412
1445
|
|