create-bunspace 0.4.0 → 0.5.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/dist/bin.js +98 -0
- package/dist/templates/fumadocs/MUST-FOLLOW-GUIDELINES.md +283 -170
- package/dist/templates/monorepo/MUST-FOLLOW-GUIDELINES.md +283 -170
- package/dist/templates/react-starter/MUST-FOLLOW-GUIDELINES.md +1845 -0
- package/dist/templates/react-starter/README.md +100 -0
- package/dist/templates/react-starter/bun.lock +1298 -0
- package/dist/templates/react-starter/components.json +27 -0
- package/dist/templates/react-starter/eslint.config.js +23 -0
- package/dist/templates/react-starter/index.html +36 -0
- package/dist/templates/react-starter/package.json +57 -0
- package/dist/templates/react-starter/public/registry.json +115 -0
- package/dist/templates/react-starter/public/themes/darkmatteviolet-dark.css +34 -0
- package/dist/templates/react-starter/public/themes/darkmatteviolet-light.css +34 -0
- package/dist/templates/react-starter/public/themes/default-dark.css +33 -0
- package/dist/templates/react-starter/public/themes/default-light.css +34 -0
- package/dist/templates/react-starter/public/themes/graphite-dark.css +34 -0
- package/dist/templates/react-starter/public/themes/graphite-light.css +34 -0
- package/dist/templates/react-starter/public/themes/synthwave84-dark.css +34 -0
- package/dist/templates/react-starter/public/themes/synthwave84-light.css +34 -0
- package/dist/templates/react-starter/public/vite.svg +1 -0
- package/dist/templates/react-starter/src/App.tsx +245 -0
- package/dist/templates/react-starter/src/assets/react.svg +1 -0
- package/dist/templates/react-starter/src/components/ThemeSelector.tsx +106 -0
- package/dist/templates/react-starter/src/components/animate-ui/components/buttons/icon.tsx +86 -0
- package/dist/templates/react-starter/src/components/animate-ui/components/buttons/theme-toggler.tsx +92 -0
- package/dist/templates/react-starter/src/components/animate-ui/primitives/animate/slot.tsx +96 -0
- package/dist/templates/react-starter/src/components/animate-ui/primitives/buttons/button.tsx +31 -0
- package/dist/templates/react-starter/src/components/animate-ui/primitives/effects/particles.tsx +155 -0
- package/dist/templates/react-starter/src/components/animate-ui/primitives/effects/theme-toggler.tsx +148 -0
- package/dist/templates/react-starter/src/components/component-example.tsx +444 -0
- package/dist/templates/react-starter/src/components/example.tsx +56 -0
- package/dist/templates/react-starter/src/index.css +131 -0
- package/dist/templates/react-starter/src/main.tsx +13 -0
- package/dist/templates/react-starter/src/providers/ThemeProvider.tsx +27 -0
- package/dist/templates/react-starter/tsconfig.app.json +36 -0
- package/dist/templates/react-starter/tsconfig.json +13 -0
- package/dist/templates/react-starter/tsconfig.node.json +26 -0
- package/dist/templates/react-starter/vite.config.ts +17 -0
- package/dist/templates/telegram-bot/MUST-FOLLOW-GUIDELINES.md +283 -170
- package/package.json +1 -1
- package/templates/fumadocs/MUST-FOLLOW-GUIDELINES.md +283 -170
- package/templates/monorepo/MUST-FOLLOW-GUIDELINES.md +283 -170
- package/templates/react-starter/MUST-FOLLOW-GUIDELINES.md +1845 -0
- package/templates/react-starter/README.md +100 -0
- package/templates/react-starter/bun.lock +1298 -0
- package/templates/react-starter/components.json +27 -0
- package/templates/react-starter/eslint.config.js +23 -0
- package/templates/react-starter/index.html +36 -0
- package/templates/react-starter/package.json +57 -0
- package/templates/react-starter/public/registry.json +115 -0
- package/templates/react-starter/public/themes/darkmatteviolet-dark.css +34 -0
- package/templates/react-starter/public/themes/darkmatteviolet-light.css +34 -0
- package/templates/react-starter/public/themes/default-dark.css +33 -0
- package/templates/react-starter/public/themes/default-light.css +34 -0
- package/templates/react-starter/public/themes/graphite-dark.css +34 -0
- package/templates/react-starter/public/themes/graphite-light.css +34 -0
- package/templates/react-starter/public/themes/synthwave84-dark.css +34 -0
- package/templates/react-starter/public/themes/synthwave84-light.css +34 -0
- package/templates/react-starter/public/vite.svg +1 -0
- package/templates/react-starter/src/App.tsx +245 -0
- package/templates/react-starter/src/assets/react.svg +1 -0
- package/templates/react-starter/src/components/ThemeSelector.tsx +106 -0
- package/templates/react-starter/src/components/animate-ui/components/buttons/icon.tsx +86 -0
- package/templates/react-starter/src/components/animate-ui/components/buttons/theme-toggler.tsx +92 -0
- package/templates/react-starter/src/components/animate-ui/primitives/animate/slot.tsx +96 -0
- package/templates/react-starter/src/components/animate-ui/primitives/buttons/button.tsx +31 -0
- package/templates/react-starter/src/components/animate-ui/primitives/effects/particles.tsx +155 -0
- package/templates/react-starter/src/components/animate-ui/primitives/effects/theme-toggler.tsx +148 -0
- package/templates/react-starter/src/components/component-example.tsx +444 -0
- package/templates/react-starter/src/components/example.tsx +56 -0
- package/templates/react-starter/src/index.css +131 -0
- package/templates/react-starter/src/main.tsx +13 -0
- package/templates/react-starter/src/providers/ThemeProvider.tsx +27 -0
- package/templates/react-starter/tsconfig.app.json +36 -0
- package/templates/react-starter/tsconfig.json +13 -0
- package/templates/react-starter/tsconfig.node.json +26 -0
- package/templates/react-starter/vite.config.ts +17 -0
- package/templates/telegram-bot/MUST-FOLLOW-GUIDELINES.md +283 -170
package/dist/bin.js
CHANGED
|
@@ -5189,6 +5189,11 @@ async function selectTemplate(args) {
|
|
|
5189
5189
|
title: "Fumadocs - Documentaci\xF3n con Next.js + MDX + Fumadocs",
|
|
5190
5190
|
value: "fumadocs",
|
|
5191
5191
|
description: "Bilingual documentation site with GitHub Pages deployment"
|
|
5192
|
+
},
|
|
5193
|
+
{
|
|
5194
|
+
title: "React Starter - BaseUI + React 19 + Vite 8 + Theme Manager",
|
|
5195
|
+
value: "react-starter",
|
|
5196
|
+
description: "Opinionated React starter with animated UI components and theme management"
|
|
5192
5197
|
}
|
|
5193
5198
|
]
|
|
5194
5199
|
}, {
|
|
@@ -5444,6 +5449,69 @@ Operation cancelled`));
|
|
|
5444
5449
|
runInstall: args.noInstall ? false : response.runInstall ?? true
|
|
5445
5450
|
};
|
|
5446
5451
|
}
|
|
5452
|
+
async function promptReactStarter(args) {
|
|
5453
|
+
const gitUser = await getGitUser();
|
|
5454
|
+
const parsed = parseProjectArg(args.projectName);
|
|
5455
|
+
const response = await import_prompts.default([
|
|
5456
|
+
{
|
|
5457
|
+
type: args.projectName ? null : "text",
|
|
5458
|
+
name: "name",
|
|
5459
|
+
message: "Project name",
|
|
5460
|
+
initial: parsed.name,
|
|
5461
|
+
validate: (value) => {
|
|
5462
|
+
if (!value)
|
|
5463
|
+
return "Project name is required";
|
|
5464
|
+
if (!isValidProjectName(value)) {
|
|
5465
|
+
return "Invalid name. Use lowercase letters, numbers, and hyphens only";
|
|
5466
|
+
}
|
|
5467
|
+
return true;
|
|
5468
|
+
},
|
|
5469
|
+
format: (value) => value.toLowerCase().trim()
|
|
5470
|
+
},
|
|
5471
|
+
{
|
|
5472
|
+
type: args.description ? null : "text",
|
|
5473
|
+
name: "description",
|
|
5474
|
+
message: "Description",
|
|
5475
|
+
initial: "React app with BaseUI, theme management, and animated components"
|
|
5476
|
+
},
|
|
5477
|
+
{
|
|
5478
|
+
type: args.author ? null : "text",
|
|
5479
|
+
name: "author",
|
|
5480
|
+
message: "Author",
|
|
5481
|
+
initial: gitUser || "Anonymous"
|
|
5482
|
+
},
|
|
5483
|
+
{
|
|
5484
|
+
type: args.noGit ? null : "confirm",
|
|
5485
|
+
name: "initGit",
|
|
5486
|
+
message: "Initialize git repository?",
|
|
5487
|
+
initial: true
|
|
5488
|
+
},
|
|
5489
|
+
{
|
|
5490
|
+
type: args.noInstall ? null : "confirm",
|
|
5491
|
+
name: "runInstall",
|
|
5492
|
+
message: "Run bun install?",
|
|
5493
|
+
initial: true
|
|
5494
|
+
}
|
|
5495
|
+
], {
|
|
5496
|
+
onCancel: () => {
|
|
5497
|
+
console.log(kleur_default.red(`
|
|
5498
|
+
Operation cancelled`));
|
|
5499
|
+
process.exit(0);
|
|
5500
|
+
}
|
|
5501
|
+
});
|
|
5502
|
+
const name = args.projectName ? parsed.name : response.name;
|
|
5503
|
+
const targetDir = args.dir || `./${name}`;
|
|
5504
|
+
return {
|
|
5505
|
+
template: "react-starter",
|
|
5506
|
+
name,
|
|
5507
|
+
scope: "",
|
|
5508
|
+
description: args.description || response.description || "",
|
|
5509
|
+
author: args.author || response.author || gitUser || "Anonymous",
|
|
5510
|
+
targetDir,
|
|
5511
|
+
initGit: args.noGit ? false : response.initGit ?? true,
|
|
5512
|
+
runInstall: args.noInstall ? false : response.runInstall ?? true
|
|
5513
|
+
};
|
|
5514
|
+
}
|
|
5447
5515
|
async function promptUser(args, templateType) {
|
|
5448
5516
|
if (templateType === "telegram-bot") {
|
|
5449
5517
|
return promptTelegramBot(args);
|
|
@@ -5451,6 +5519,9 @@ async function promptUser(args, templateType) {
|
|
|
5451
5519
|
if (templateType === "fumadocs") {
|
|
5452
5520
|
return promptFumadocs(args);
|
|
5453
5521
|
}
|
|
5522
|
+
if (templateType === "react-starter") {
|
|
5523
|
+
return promptReactStarter(args);
|
|
5524
|
+
}
|
|
5454
5525
|
return promptMonorepo(args);
|
|
5455
5526
|
}
|
|
5456
5527
|
async function getDefaultsMonorepo(args) {
|
|
@@ -5512,8 +5583,26 @@ async function getDefaults(args, templateType) {
|
|
|
5512
5583
|
if (templateType === "fumadocs") {
|
|
5513
5584
|
return getDefaultsFumadocs(args);
|
|
5514
5585
|
}
|
|
5586
|
+
if (templateType === "react-starter") {
|
|
5587
|
+
return getDefaultsReactStarter(args);
|
|
5588
|
+
}
|
|
5515
5589
|
return getDefaultsMonorepo(args);
|
|
5516
5590
|
}
|
|
5591
|
+
async function getDefaultsReactStarter(args) {
|
|
5592
|
+
const gitUser = await getGitUser();
|
|
5593
|
+
const parsed = parseProjectArg(args.projectName);
|
|
5594
|
+
const targetDir = args.dir || parsed.targetDir;
|
|
5595
|
+
return {
|
|
5596
|
+
template: "react-starter",
|
|
5597
|
+
name: parsed.name,
|
|
5598
|
+
scope: "",
|
|
5599
|
+
description: args.description || "React app with BaseUI, theme management, and animated components",
|
|
5600
|
+
author: args.author || gitUser || "Anonymous",
|
|
5601
|
+
targetDir,
|
|
5602
|
+
initGit: !args.noGit,
|
|
5603
|
+
runInstall: !args.noInstall
|
|
5604
|
+
};
|
|
5605
|
+
}
|
|
5517
5606
|
|
|
5518
5607
|
// src/generator.ts
|
|
5519
5608
|
import { mkdir, readdir, stat as stat2, readFile as readFile2, writeFile as writeFile2, copyFile, rename } from "fs/promises";
|
|
@@ -5803,6 +5892,15 @@ function generatePlaceholders(config, templateType) {
|
|
|
5803
5892
|
SUPPORTED_LOCALES: config.supportedLocales || "es,en"
|
|
5804
5893
|
};
|
|
5805
5894
|
}
|
|
5895
|
+
if (templateType === "react-starter") {
|
|
5896
|
+
const projectTitle = config.name.split("-").map((word) => word.charAt(0).toUpperCase() + word.slice(1)).join(" ");
|
|
5897
|
+
return {
|
|
5898
|
+
...base,
|
|
5899
|
+
PROJECT_NAME: config.name,
|
|
5900
|
+
PROJECT_TITLE: projectTitle,
|
|
5901
|
+
DESCRIPTION: config.description
|
|
5902
|
+
};
|
|
5903
|
+
}
|
|
5806
5904
|
throw new Error(`Unknown template: ${templateType}`);
|
|
5807
5905
|
}
|
|
5808
5906
|
async function copyTemplateDir(src, dest, placeholders) {
|
|
@@ -18,6 +18,91 @@
|
|
|
18
18
|
| **Versioning** | Changesets v2.27.11 | Versionado de packages |
|
|
19
19
|
| **Logging** | @mks2508/better-logger v4.0.0 | Logging estructurado |
|
|
20
20
|
| **Error Handling** | @mks2508/no-throw v0.1.0 | Result pattern |
|
|
21
|
+
| **Commit Generation** | gemini-commit-wizard v1.1.3 | Commits estructurados con IA multi-provider |
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## Commit Workflow — gemini-commit-wizard
|
|
26
|
+
|
|
27
|
+
**OBLIGATORIO**: Usar `bun run commit` para TODOS los commits. NUNCA hacer commits manuales sin formato estructurado.
|
|
28
|
+
|
|
29
|
+
### Providers Disponibles
|
|
30
|
+
|
|
31
|
+
| Provider | Variable de Entorno | Modelo Default | Velocidad |
|
|
32
|
+
|----------|-------------------|---------------|-----------|
|
|
33
|
+
| **Gemini SDK** | `GEMINI_API_KEY` | `gemini-2.5-flash` | Rapido |
|
|
34
|
+
| **Groq** | `GROQ_API_KEY` | `llama-3.3-70b-versatile` | Ultra-rapido |
|
|
35
|
+
| **OpenRouter** | `OPENROUTER_API_KEY` | `anthropic/claude-sonnet-4` | Variable |
|
|
36
|
+
| **Gemini CLI** | _(necesita binario `gemini`)_ | CLI default | Moderado |
|
|
37
|
+
|
|
38
|
+
**Auto-deteccion**: Gemini SDK > Groq > OpenRouter > Gemini CLI. El primer provider con API key valida se usa automaticamente.
|
|
39
|
+
|
|
40
|
+
### Comandos
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
# Commit interactivo con IA (auto-detecta provider)
|
|
44
|
+
bun run commit
|
|
45
|
+
|
|
46
|
+
# Modo rapido sin prompts
|
|
47
|
+
bun run commit:quick
|
|
48
|
+
|
|
49
|
+
# Auto-aprobar sin push
|
|
50
|
+
bun run commit:auto
|
|
51
|
+
|
|
52
|
+
# Provider especifico
|
|
53
|
+
bun run commit -- --provider groq
|
|
54
|
+
|
|
55
|
+
# Provider + modelo especifico
|
|
56
|
+
bun run commit -- --provider openrouter --model anthropic/claude-sonnet-4
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### Formato de Commit Estructurado
|
|
60
|
+
|
|
61
|
+
```
|
|
62
|
+
type(scope): description
|
|
63
|
+
|
|
64
|
+
Body text (en idioma configurado)
|
|
65
|
+
|
|
66
|
+
<technical>
|
|
67
|
+
- Detalles tecnicos: archivos, funciones, tipos modificados
|
|
68
|
+
</technical>
|
|
69
|
+
|
|
70
|
+
<changelog>
|
|
71
|
+
## [Type] [Emoji]
|
|
72
|
+
Entrada de changelog orientada al usuario
|
|
73
|
+
</changelog>
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
**Types validos**: `feat`, `fix`, `refactor`, `docs`, `test`, `feat-phase` (feature incompleta)
|
|
77
|
+
|
|
78
|
+
### Configuracion por Proyecto
|
|
79
|
+
|
|
80
|
+
Crear `.commit-wizard.json` en la raiz del proyecto:
|
|
81
|
+
|
|
82
|
+
```json
|
|
83
|
+
{
|
|
84
|
+
"name": "mi-proyecto",
|
|
85
|
+
"description": "Descripcion breve",
|
|
86
|
+
"techStack": ["TypeScript", "Bun"],
|
|
87
|
+
"components": [
|
|
88
|
+
{ "id": "api", "path": "src/api/", "name": "REST API" }
|
|
89
|
+
],
|
|
90
|
+
"commitFormat": {
|
|
91
|
+
"titleLanguage": "english",
|
|
92
|
+
"bodyLanguage": "spanish",
|
|
93
|
+
"includeTechnical": true,
|
|
94
|
+
"includeChangelog": true
|
|
95
|
+
},
|
|
96
|
+
"provider": "groq",
|
|
97
|
+
"model": "llama-3.3-70b-versatile"
|
|
98
|
+
}
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
### Prohibido
|
|
102
|
+
|
|
103
|
+
- `git commit -m "mensaje"` sin formato estructurado
|
|
104
|
+
- Commits sin `<technical>` y `<changelog>` sections
|
|
105
|
+
- Usar providers sin API key configurada (el wizard valida automaticamente)
|
|
21
106
|
|
|
22
107
|
---
|
|
23
108
|
|
|
@@ -1167,39 +1252,43 @@ Antes de hacer commit de codigo, verificar:
|
|
|
1167
1252
|
|
|
1168
1253
|
---
|
|
1169
1254
|
|
|
1170
|
-
## REGLA 13: UI Components - Shadcn
|
|
1255
|
+
## REGLA 13: UI Components - Shadcn MCP + React Bits + lucide-animated
|
|
1171
1256
|
|
|
1172
1257
|
### Stack de Componentes UI
|
|
1173
1258
|
|
|
1174
|
-
**OBLIGATORIO**: Shadcn
|
|
1259
|
+
**OBLIGATORIO**: Usar Shadcn MCP Server para instalar componentes via registries externos.
|
|
1260
|
+
|
|
1261
|
+
| Registry | URL | Tipo | Prioridad |
|
|
1262
|
+
|----------|-----|------|-----------|
|
|
1263
|
+
| **@animate-ui** | `https://animate-ui.com/r/{name}.json` | Componentes Shadcn con animaciones | **1º PREFERIDO** |
|
|
1264
|
+
| **@react-bits** | `https://reactbits.dev/r/{name}.json` | Componentes interactivos/efectos | **2º PREFERIDO** |
|
|
1265
|
+
| **@lucide-animated** | `https://lucide-animated.com/r/{name}.json` | Iconos animados (350+) | **PREFERIDO** |
|
|
1266
|
+
| **@prompt-kit** | `https://prompt-kit.com/c/{name}.json` | Chat/Prompt UI | **PREFERIDO** para agents |
|
|
1267
|
+
| **@shadcn** | Registry base | Componentes base estándar | Fallback |
|
|
1175
1268
|
|
|
1176
|
-
###
|
|
1269
|
+
### Configuracion MCP Server (Primera vez)
|
|
1177
1270
|
|
|
1178
1271
|
```bash
|
|
1179
|
-
#
|
|
1180
|
-
|
|
1181
|
-
bunx --bun shadcn@latest add @animate-ui/primitives-button
|
|
1182
|
-
bunx --bun shadcn@latest add @animate-ui/primitives-card
|
|
1272
|
+
# En el directorio del proyecto
|
|
1273
|
+
npx shadcn@latest mcp init --client claude
|
|
1183
1274
|
|
|
1184
|
-
#
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1275
|
+
# Esto genera .mcp.json en la raiz del proyecto:
|
|
1276
|
+
{
|
|
1277
|
+
"mcpServers": {
|
|
1278
|
+
"shadcn": {
|
|
1279
|
+
"command": "npx",
|
|
1280
|
+
"args": ["shadcn@latest", "mcp"]
|
|
1281
|
+
}
|
|
1282
|
+
}
|
|
1283
|
+
}
|
|
1188
1284
|
|
|
1189
|
-
#
|
|
1190
|
-
# https://ui.shadcn.com/docs/mcp
|
|
1285
|
+
# Reiniciar Claude Code y verificar con /mcp
|
|
1191
1286
|
```
|
|
1192
1287
|
|
|
1193
|
-
### Fuentes de Componentes
|
|
1194
|
-
|
|
1195
|
-
| Fuente | Prefijo | Tipo | Prioridad |
|
|
1196
|
-
|--------|---------|------|-----------|
|
|
1197
|
-
| **Animate UI** | `@animate-ui/primitives-*` | Componentes con animaciones | **PREFERIDO** |
|
|
1198
|
-
| **Shadcn Registry** | `shadcn/*` | Componentes base estándar | Alternativa |
|
|
1199
|
-
| **Radix UI** | `@radix-ui/*` | Primitivas sin estilos | Solo si es necesario |
|
|
1200
|
-
|
|
1201
1288
|
### Configuracion de components.json
|
|
1202
1289
|
|
|
1290
|
+
**OBLIGATORIO**: Agregar registries externos al `components.json`:
|
|
1291
|
+
|
|
1203
1292
|
```json
|
|
1204
1293
|
{
|
|
1205
1294
|
"$schema": "https://ui.shadcn.com/schema.json",
|
|
@@ -1207,209 +1296,232 @@ bunx --bun shadcn@latest add dialog
|
|
|
1207
1296
|
"rsc": false,
|
|
1208
1297
|
"tsx": true,
|
|
1209
1298
|
"tailwind": {
|
|
1210
|
-
"config": "
|
|
1299
|
+
"config": "",
|
|
1211
1300
|
"css": "src/app/globals.css",
|
|
1212
|
-
"baseColor": "
|
|
1301
|
+
"baseColor": "zinc",
|
|
1213
1302
|
"cssVariables": true,
|
|
1214
1303
|
"prefix": ""
|
|
1215
1304
|
},
|
|
1305
|
+
"iconLibrary": "lucide",
|
|
1216
1306
|
"aliases": {
|
|
1217
1307
|
"components": "@/components",
|
|
1218
1308
|
"utils": "@/lib/utils",
|
|
1219
|
-
"ui": "@/components/ui"
|
|
1309
|
+
"ui": "@/components/ui",
|
|
1310
|
+
"lib": "@/lib",
|
|
1311
|
+
"hooks": "@/hooks"
|
|
1220
1312
|
},
|
|
1221
|
-
"
|
|
1313
|
+
"registries": {
|
|
1314
|
+
"@animate-ui": "https://animate-ui.com/r/{name}.json",
|
|
1315
|
+
"@react-bits": "https://reactbits.dev/r/{name}.json",
|
|
1316
|
+
"@lucide-animated": "https://lucide-animated.com/r/{name}.json",
|
|
1317
|
+
"@prompt-kit": "https://prompt-kit.com/c/{name}.json"
|
|
1318
|
+
}
|
|
1222
1319
|
}
|
|
1223
1320
|
```
|
|
1224
1321
|
|
|
1225
|
-
###
|
|
1226
|
-
|
|
1227
|
-
```typescript
|
|
1228
|
-
// CORRECTO - Importar desde components/ui
|
|
1229
|
-
import { Button } from '@/components/ui/button';
|
|
1230
|
-
import { Card } from '@/components/ui/card';
|
|
1231
|
-
|
|
1232
|
-
// CORRECTO - Componentes Animate UI
|
|
1233
|
-
import { SlidingNumber } from '@/components/ui/sliding-number';
|
|
1234
|
-
import { AnimatedCard } from '@/components/ui/animated-card';
|
|
1235
|
-
import { MorphingText } from '@/components/ui/morphing-text';
|
|
1236
|
-
|
|
1237
|
-
// INCORRECTO - Importar directo desde node_modules
|
|
1238
|
-
import { Button } from '@radix-ui/react-button';
|
|
1239
|
-
```
|
|
1240
|
-
|
|
1241
|
-
### Componentes Recomendados (Animate UI)
|
|
1242
|
-
|
|
1243
|
-
| Componente | Prefijo | Uso |
|
|
1244
|
-
|-----------|---------|-----|
|
|
1245
|
-
| `sliding-number` | `@animate-ui/primitives-texts-*` | Números animados, contadores |
|
|
1246
|
-
| `morphing-text` | `@animate-ui/primitives-texts-*` | Texto que transforma entre valores |
|
|
1247
|
-
| `animated-card` | `@animate-ui/primitives-card*` | Tarjetas con animaciones de entrada |
|
|
1248
|
-
| `progress-reveal` | `@animate-ui/primitives-progress-*` | Progress con animación suave |
|
|
1249
|
-
| `slide-toggle` | `@animate-ui/primitives-toggle-*` | Switch con animación |
|
|
1250
|
-
|
|
1251
|
-
### Componentes Base Shadcn (cuando Animate UI no disponible)
|
|
1252
|
-
|
|
1253
|
-
```bash
|
|
1254
|
-
# Instalar componentes base esenciales
|
|
1255
|
-
bunx --bun shadcn@latest add button
|
|
1256
|
-
bunx --bun shadcn@latest add card
|
|
1257
|
-
bunx --bun shadcn@latest add input
|
|
1258
|
-
bunx --bun shadcn@latest add textarea
|
|
1259
|
-
bunx --bun shadcn@latest add accordion
|
|
1260
|
-
bunx --bun shadcn@latest add dialog
|
|
1261
|
-
bunx --bun shadcn@latest add dropdown-menu
|
|
1262
|
-
bunx --bun shadcn@latest add toast
|
|
1263
|
-
bunx --bun shadcn@latest add tooltip
|
|
1264
|
-
```
|
|
1265
|
-
|
|
1266
|
-
### Inicializar Shadcn/UI (Primera vez)
|
|
1322
|
+
### Comandos de Instalacion
|
|
1267
1323
|
|
|
1268
1324
|
```bash
|
|
1269
|
-
#
|
|
1270
|
-
bunx --bun shadcn@latest
|
|
1325
|
+
# 1º Animate UI (componentes Shadcn con animaciones - PREFERIDO)
|
|
1326
|
+
bunx --bun shadcn@latest add @animate-ui/sliding-number
|
|
1327
|
+
bunx --bun shadcn@latest add @animate-ui/morphing-text
|
|
1328
|
+
bunx --bun shadcn@latest add @animate-ui/animated-card
|
|
1329
|
+
bunx --bun shadcn@latest add @animate-ui/progress-reveal
|
|
1271
1330
|
|
|
1272
|
-
#
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
# - Tailwind config: tailwind.config.ts
|
|
1277
|
-
# - Components path: @/components
|
|
1278
|
-
# - Utils path: @/lib/utils
|
|
1279
|
-
```
|
|
1331
|
+
# 2º React Bits (efectos interactivos)
|
|
1332
|
+
bunx --bun shadcn@latest add @react-bits/fade-content
|
|
1333
|
+
bunx --bun shadcn@latest add @react-bits/magnet
|
|
1334
|
+
bunx --bun shadcn@latest add @react-bits/dock
|
|
1280
1335
|
|
|
1281
|
-
|
|
1336
|
+
# 3º Iconos animados lucide-animated
|
|
1337
|
+
bunx --bun shadcn@latest add @lucide-animated/check-circle
|
|
1338
|
+
bunx --bun shadcn@latest add @lucide-animated/loader
|
|
1339
|
+
bunx --bun shadcn@latest add @lucide-animated/play
|
|
1282
1340
|
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
import { MorphingText } from '@/components/ui/morphing-text';
|
|
1287
|
-
import { SlidingNumber } from '@/components/ui/sliding-number';
|
|
1288
|
-
import type { IMessage } from './MessageItem.types';
|
|
1341
|
+
# 4º prompt-kit (chat/agent UI)
|
|
1342
|
+
bunx --bun shadcn@latest add @prompt-kit/prompt-input
|
|
1343
|
+
bunx --bun shadcn@latest add @prompt-kit/response-stream
|
|
1289
1344
|
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
<AnimatedCard className="p-4">
|
|
1293
|
-
<div className="flex items-center gap-2">
|
|
1294
|
-
<MorphingText>{message.content}</MorphingText>
|
|
1295
|
-
{message.progress && (
|
|
1296
|
-
<SlidingNumber value={message.progress.percentage} />
|
|
1297
|
-
)}
|
|
1298
|
-
</div>
|
|
1299
|
-
</AnimatedCard>
|
|
1300
|
-
);
|
|
1301
|
-
}
|
|
1345
|
+
# 5º Shadcn base (solo si no hay alternativa animada)
|
|
1346
|
+
bunx --bun shadcn@latest add button card dialog
|
|
1302
1347
|
```
|
|
1303
1348
|
|
|
1304
|
-
###
|
|
1349
|
+
### Uso con Claude Code MCP
|
|
1305
1350
|
|
|
1306
|
-
|
|
1307
|
-
# Usar el MCP server de Shadcn para buscar componentes
|
|
1308
|
-
# Ver documentacion: https://ui.shadcn.com/docs/mcp
|
|
1351
|
+
Despues de configurar el MCP, usar prompts naturales:
|
|
1309
1352
|
|
|
1310
|
-
# Ejemplos de busqueda via MCP:
|
|
1311
|
-
# - "text animation components"
|
|
1312
|
-
# - "card with entrance animation"
|
|
1313
|
-
# - "progress with reveal effect"
|
|
1314
1353
|
```
|
|
1354
|
+
# React Bits
|
|
1355
|
+
"Show me all available backgrounds from @react-bits"
|
|
1356
|
+
"Add the Dither background from React Bits to the page, make it purple"
|
|
1357
|
+
"Add FadeContent from @react-bits for scroll animations"
|
|
1315
1358
|
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1359
|
+
# lucide-animated
|
|
1360
|
+
"Show me all available icons from @lucide-animated"
|
|
1361
|
+
"Add the check-circle animated icon from lucide-animated"
|
|
1319
1362
|
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
**OBLIGATORIO**: lucie-animated como fuente principal para iconos animados.
|
|
1323
|
-
|
|
1324
|
-
### Formato de Comandos
|
|
1325
|
-
|
|
1326
|
-
```bash
|
|
1327
|
-
# CORRECTO - Formato estandar con Bun
|
|
1328
|
-
bunx --bun shadcn@latest add @lucie-animated/a-arrow-up
|
|
1329
|
-
bunx --bun shadcn@latest add @lucie-animated/arrow-down
|
|
1330
|
-
bunx --bun shadcn@latest add @lucie-animated/check-circle
|
|
1331
|
-
bunx --bun shadcn@latest add @lucie-animated/x-circle
|
|
1363
|
+
# Combinados
|
|
1364
|
+
"Create a hero section with FadeContent animation and animated icons"
|
|
1332
1365
|
```
|
|
1333
1366
|
|
|
1334
|
-
###
|
|
1367
|
+
### Componentes React Bits Recomendados
|
|
1335
1368
|
|
|
1336
|
-
|
|
|
1337
|
-
|
|
1338
|
-
|
|
|
1339
|
-
|
|
|
1340
|
-
|
|
|
1369
|
+
| Componente | Categoria | Uso |
|
|
1370
|
+
|-----------|-----------|-----|
|
|
1371
|
+
| `fade-content` | Animations | Fade in/out con scroll |
|
|
1372
|
+
| `text-pressure` | Text Effects | Texto con efecto presion |
|
|
1373
|
+
| `magnet` | Interactions | Efecto magnetico cursor |
|
|
1374
|
+
| `dock` | Components | Dock estilo macOS |
|
|
1375
|
+
| `tilted-card` | Components | Cards con tilt 3D |
|
|
1376
|
+
| `spotlight-card` | Components | Cards con spotlight |
|
|
1377
|
+
| `dither` | Backgrounds | Fondo con efecto dither |
|
|
1378
|
+
| `hyperspeed` | Backgrounds | Efecto velocidad |
|
|
1341
1379
|
|
|
1342
|
-
###
|
|
1380
|
+
### Iconos lucide-animated Recomendados
|
|
1343
1381
|
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
# - Media: play, pause, volume, volume-x
|
|
1354
|
-
```
|
|
1382
|
+
| Icono | Uso |
|
|
1383
|
+
|-------|-----|
|
|
1384
|
+
| `check-circle` | Confirmacion, exito |
|
|
1385
|
+
| `x-circle` | Error, cerrar |
|
|
1386
|
+
| `loader` | Loading states |
|
|
1387
|
+
| `play` / `pause` | Media controls |
|
|
1388
|
+
| `arrow-up` / `arrow-down` | Navegacion |
|
|
1389
|
+
| `settings` | Configuracion |
|
|
1390
|
+
| `bell` | Notificaciones |
|
|
1355
1391
|
|
|
1356
1392
|
### Patrones de Importacion
|
|
1357
1393
|
|
|
1358
1394
|
```typescript
|
|
1359
|
-
// CORRECTO -
|
|
1360
|
-
import {
|
|
1361
|
-
import {
|
|
1395
|
+
// CORRECTO - Componentes React Bits
|
|
1396
|
+
import { FadeContent } from '@/components/ui/fade-content';
|
|
1397
|
+
import { TextPressure } from '@/components/ui/text-pressure';
|
|
1398
|
+
import { Dock } from '@/components/ui/dock';
|
|
1399
|
+
|
|
1400
|
+
// CORRECTO - Iconos animados lucide-animated
|
|
1362
1401
|
import { CheckCircle } from '@/components/icons/check-circle';
|
|
1363
|
-
import {
|
|
1402
|
+
import { Loader } from '@/components/icons/loader';
|
|
1403
|
+
|
|
1404
|
+
// CORRECTO - Componentes base Shadcn
|
|
1405
|
+
import { Button } from '@/components/ui/button';
|
|
1406
|
+
import { Card } from '@/components/ui/card';
|
|
1364
1407
|
|
|
1365
|
-
// CORRECTO -
|
|
1408
|
+
// CORRECTO - Iconos estaticos (fallback)
|
|
1366
1409
|
import { Settings } from 'lucide-react';
|
|
1367
1410
|
|
|
1368
|
-
// INCORRECTO - Importar directo desde
|
|
1369
|
-
import {
|
|
1411
|
+
// INCORRECTO - Importar directo desde node_modules
|
|
1412
|
+
import { FadeContent } from 'react-bits';
|
|
1370
1413
|
```
|
|
1371
1414
|
|
|
1372
|
-
### Estructura de
|
|
1415
|
+
### Estructura de Carpetas
|
|
1373
1416
|
|
|
1374
1417
|
```
|
|
1375
1418
|
components/
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1419
|
+
├── ui/ # Componentes UI (Shadcn + React Bits)
|
|
1420
|
+
│ ├── button.tsx
|
|
1421
|
+
│ ├── card.tsx
|
|
1422
|
+
│ ├── fade-content.tsx # React Bits
|
|
1423
|
+
│ ├── text-pressure.tsx # React Bits
|
|
1424
|
+
│ ├── dock.tsx # React Bits
|
|
1425
|
+
│ └── index.ts # Barrel export
|
|
1426
|
+
├── icons/ # Iconos animados (lucide-animated)
|
|
1427
|
+
│ ├── check-circle.tsx
|
|
1428
|
+
│ ├── loader.tsx
|
|
1429
|
+
│ ├── play.tsx
|
|
1430
|
+
│ └── index.ts # Barrel export
|
|
1431
|
+
└── agent/ # Componentes de dominio
|
|
1432
|
+
└── ...
|
|
1381
1433
|
```
|
|
1382
1434
|
|
|
1383
1435
|
### Ejemplo Completo de Uso
|
|
1384
1436
|
|
|
1385
1437
|
```typescript
|
|
1386
|
-
// components/agent/
|
|
1387
|
-
import {
|
|
1388
|
-
import {
|
|
1438
|
+
// components/agent/MessageItem.tsx
|
|
1439
|
+
import { FadeContent } from '@/components/ui/fade-content';
|
|
1440
|
+
import { Card } from '@/components/ui/card';
|
|
1389
1441
|
import { CheckCircle } from '@/components/icons/check-circle';
|
|
1390
|
-
import
|
|
1442
|
+
import { Loader } from '@/components/icons/loader';
|
|
1443
|
+
import type { IMessageItemProps } from './MessageItem.types';
|
|
1391
1444
|
|
|
1392
|
-
export function
|
|
1445
|
+
export function MessageItem({ message, isLoading }: IMessageItemProps) {
|
|
1393
1446
|
return (
|
|
1394
|
-
<
|
|
1395
|
-
<
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1447
|
+
<FadeContent direction="up" duration={0.4}>
|
|
1448
|
+
<Card className="p-4">
|
|
1449
|
+
<div className="flex items-center gap-2">
|
|
1450
|
+
{isLoading ? (
|
|
1451
|
+
<Loader className="w-5 h-5 animate-spin" />
|
|
1452
|
+
) : (
|
|
1453
|
+
<CheckCircle className="w-5 h-5 text-green-500" />
|
|
1454
|
+
)}
|
|
1455
|
+
<span>{message.content}</span>
|
|
1456
|
+
</div>
|
|
1457
|
+
</Card>
|
|
1458
|
+
</FadeContent>
|
|
1404
1459
|
);
|
|
1405
1460
|
}
|
|
1406
1461
|
```
|
|
1407
1462
|
|
|
1463
|
+
### Debug MCP
|
|
1464
|
+
|
|
1465
|
+
```bash
|
|
1466
|
+
# En Claude Code, usar /mcp para verificar conexion
|
|
1467
|
+
/mcp
|
|
1468
|
+
|
|
1469
|
+
# Debe mostrar "shadcn" en la lista de servers activos
|
|
1470
|
+
# Si hay problemas, reiniciar Claude Code
|
|
1471
|
+
```
|
|
1472
|
+
|
|
1408
1473
|
### Referencias
|
|
1409
1474
|
|
|
1410
|
-
- **
|
|
1411
|
-
- **lucide-
|
|
1412
|
-
- **Shadcn
|
|
1475
|
+
- **React Bits**: https://reactbits.dev/
|
|
1476
|
+
- **lucide-animated**: https://lucide-animated.com/
|
|
1477
|
+
- **Shadcn MCP**: https://ui.shadcn.com/docs/mcp
|
|
1478
|
+
- **Shadcn Registry**: https://ui.shadcn.com/
|
|
1479
|
+
|
|
1480
|
+
---
|
|
1481
|
+
|
|
1482
|
+
## REGLA 14: Package UI Compartido
|
|
1483
|
+
|
|
1484
|
+
### Estructura del Package UI
|
|
1485
|
+
|
|
1486
|
+
El monorepo tiene un package UI compartido en `core/packages/ui/` para componentes reutilizables:
|
|
1487
|
+
|
|
1488
|
+
```
|
|
1489
|
+
core/packages/ui/
|
|
1490
|
+
├── src/
|
|
1491
|
+
│ ├── components/
|
|
1492
|
+
│ │ ├── ui/ # Componentes Shadcn + React Bits
|
|
1493
|
+
│ │ ├── icons/ # Iconos lucide-animated
|
|
1494
|
+
│ │ └── agent/ # Componentes de dominio
|
|
1495
|
+
│ ├── lib/
|
|
1496
|
+
│ │ └── utils.ts # cn() y utilidades
|
|
1497
|
+
│ ├── hooks/ # Hooks compartidos
|
|
1498
|
+
│ └── index.ts # Barrel export
|
|
1499
|
+
├── components.json # Config Shadcn con registries
|
|
1500
|
+
├── package.json
|
|
1501
|
+
├── rolldown.config.ts
|
|
1502
|
+
└── tsconfig.json
|
|
1503
|
+
```
|
|
1504
|
+
|
|
1505
|
+
### Uso del Package UI
|
|
1506
|
+
|
|
1507
|
+
```typescript
|
|
1508
|
+
// Importar desde el package compartido
|
|
1509
|
+
import { Button, Card, FadeContent } from 'mks-dev-environment/ui';
|
|
1510
|
+
import { CheckCircle, Loader } from 'mks-dev-environment/ui/icons';
|
|
1511
|
+
import { cn } from 'mks-dev-environment/ui/lib/utils';
|
|
1512
|
+
```
|
|
1513
|
+
|
|
1514
|
+
### Instalacion de Componentes en Package UI
|
|
1515
|
+
|
|
1516
|
+
```bash
|
|
1517
|
+
# Ir al directorio del package UI
|
|
1518
|
+
cd core/packages/ui
|
|
1519
|
+
|
|
1520
|
+
# Instalar componentes (se guardan en src/components/ui/)
|
|
1521
|
+
bunx --bun shadcn@latest add @react-bits/fade-content
|
|
1522
|
+
bunx --bun shadcn@latest add @lucide-animated/check-circle
|
|
1523
|
+
bunx --bun shadcn@latest add button card
|
|
1524
|
+
```
|
|
1413
1525
|
|
|
1414
1526
|
### Referencias
|
|
1415
1527
|
|
|
@@ -1707,8 +1819,9 @@ Glassmorphism es la combinación controlada de:
|
|
|
1707
1819
|
- **Oxlint** - https://oxlint.com/
|
|
1708
1820
|
- **Zustand** - https://zustand-demo.pmnd.rs/
|
|
1709
1821
|
- **Shadcn/UI** - https://ui.shadcn.com/
|
|
1710
|
-
- **
|
|
1711
|
-
- **
|
|
1822
|
+
- **Shadcn MCP** - https://ui.shadcn.com/docs/mcp
|
|
1823
|
+
- **React Bits** - https://reactbits.dev/
|
|
1824
|
+
- **lucide-animated** - https://lucide-animated.com/
|
|
1712
1825
|
|
|
1713
1826
|
### Documentación en Dotfiles
|
|
1714
1827
|
|