create-huenei-frontend 0.1.2
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/bin/create-huenei-frontend.js +2 -0
- package/dist/index.js +99 -0
- package/dist/templates/clean/.cursor/skills/architecture/SKILL.md +26 -0
- package/dist/templates/clean/.cursor/skills/components-shadcn/SKILL.md +23 -0
- package/dist/templates/clean/.cursor/skills/daisyui/SKILL.md +98 -0
- package/dist/templates/clean/.cursor/skills/routing/SKILL.md +32 -0
- package/dist/templates/clean/.cursor/skills/testing/SKILL.md +55 -0
- package/dist/templates/clean/.cursor/skills/tooling-and-scripts/SKILL.md +24 -0
- package/dist/templates/clean/.cursor/skills/ui-and-styling/SKILL.md +32 -0
- package/dist/templates/clean/.cursor/skills/vibe-and-ia/SKILL.md +23 -0
- package/dist/templates/clean/.prettierrc +6 -0
- package/dist/templates/clean/.tanstack/tmp/c28007bb-2319511cf318e28129c8d8eb723db5fd +9 -0
- package/dist/templates/clean/.tanstack/tmp/c28007bb-bcef89e9e4593777e1c15ec4b4f32eea +9 -0
- package/dist/templates/clean/.vscode/extensions.json +7 -0
- package/dist/templates/clean/README.md +75 -0
- package/dist/templates/clean/components.json +22 -0
- package/dist/templates/clean/eslint.config.js +31 -0
- package/dist/templates/clean/index.html +13 -0
- package/dist/templates/clean/package.json +62 -0
- package/dist/templates/clean/pnpm-lock.yaml +4487 -0
- package/dist/templates/clean/pnpm-workspace.yaml +2 -0
- package/dist/templates/clean/src/assets/react.svg +1 -0
- package/dist/templates/clean/src/components/ui/badge.tsx +37 -0
- package/dist/templates/clean/src/components/ui/breadcrumb.tsx +106 -0
- package/dist/templates/clean/src/components/ui/button.tsx +58 -0
- package/dist/templates/clean/src/components/ui/card.tsx +72 -0
- package/dist/templates/clean/src/components/ui/form.tsx +165 -0
- package/dist/templates/clean/src/components/ui/input.tsx +22 -0
- package/dist/templates/clean/src/components/ui/label.tsx +24 -0
- package/dist/templates/clean/src/components/ui/password-input.tsx +41 -0
- package/dist/templates/clean/src/components/ui/separator.tsx +28 -0
- package/dist/templates/clean/src/components/ui/tabs.tsx +62 -0
- package/dist/templates/clean/src/components/ui/textarea.tsx +21 -0
- package/dist/templates/clean/src/index.css +104 -0
- package/dist/templates/clean/src/lib/queryClient.ts +11 -0
- package/dist/templates/clean/src/lib/utils.ts +6 -0
- package/dist/templates/clean/src/main.tsx +33 -0
- package/dist/templates/clean/src/routeTree.gen.ts +77 -0
- package/dist/templates/clean/src/router.tsx +13 -0
- package/dist/templates/clean/src/routes/__root.tsx +82 -0
- package/dist/templates/clean/src/routes/index.tsx +187 -0
- package/dist/templates/clean/src/routes/otra-ruta.tsx +319 -0
- package/dist/templates/clean/src/test/setup.ts +1 -0
- package/dist/templates/clean/tsconfig.app.json +34 -0
- package/dist/templates/clean/tsconfig.json +10 -0
- package/dist/templates/clean/tsconfig.node.json +26 -0
- package/dist/templates/clean/vite.config.ts +22 -0
- package/dist/templates/clean/vitest.config.ts +9 -0
- package/dist/templates/help/.cursor/skills/architecture/SKILL.md +26 -0
- package/dist/templates/help/.cursor/skills/components-shadcn/SKILL.md +23 -0
- package/dist/templates/help/.cursor/skills/daisyui/SKILL.md +98 -0
- package/dist/templates/help/.cursor/skills/routing/SKILL.md +32 -0
- package/dist/templates/help/.cursor/skills/testing/SKILL.md +55 -0
- package/dist/templates/help/.cursor/skills/tooling-and-scripts/SKILL.md +24 -0
- package/dist/templates/help/.cursor/skills/ui-and-styling/SKILL.md +32 -0
- package/dist/templates/help/.cursor/skills/vibe-and-ia/SKILL.md +23 -0
- package/dist/templates/help/.prettierrc +6 -0
- package/dist/templates/help/.tanstack/tmp/c28007bb-2319511cf318e28129c8d8eb723db5fd +9 -0
- package/dist/templates/help/.tanstack/tmp/c28007bb-bcef89e9e4593777e1c15ec4b4f32eea +9 -0
- package/dist/templates/help/.vscode/extensions.json +7 -0
- package/dist/templates/help/README.md +75 -0
- package/dist/templates/help/components.json +22 -0
- package/dist/templates/help/eslint.config.js +31 -0
- package/dist/templates/help/index.html +13 -0
- package/dist/templates/help/package.json +62 -0
- package/dist/templates/help/pnpm-lock.yaml +4487 -0
- package/dist/templates/help/pnpm-workspace.yaml +2 -0
- package/dist/templates/help/src/assets/react.svg +1 -0
- package/dist/templates/help/src/components/documentacion/entorno.tsx +99 -0
- package/dist/templates/help/src/components/documentacion/estructura.tsx +100 -0
- package/dist/templates/help/src/components/documentacion/figma-mcp.tsx +200 -0
- package/dist/templates/help/src/components/documentacion/inicio.tsx +69 -0
- package/dist/templates/help/src/components/documentacion/instalacion.tsx +72 -0
- package/dist/templates/help/src/components/documentacion/personalizacion.tsx +163 -0
- package/dist/templates/help/src/components/documentacion/rutas.tsx +138 -0
- package/dist/templates/help/src/components/documentacion/stack.tsx +401 -0
- package/dist/templates/help/src/components/ui/badge.tsx +37 -0
- package/dist/templates/help/src/components/ui/breadcrumb.tsx +106 -0
- package/dist/templates/help/src/components/ui/button.tsx +58 -0
- package/dist/templates/help/src/components/ui/card.tsx +72 -0
- package/dist/templates/help/src/components/ui/form.tsx +165 -0
- package/dist/templates/help/src/components/ui/input.tsx +22 -0
- package/dist/templates/help/src/components/ui/label.tsx +24 -0
- package/dist/templates/help/src/components/ui/password-input.tsx +41 -0
- package/dist/templates/help/src/components/ui/separator.tsx +28 -0
- package/dist/templates/help/src/components/ui/tabs.tsx +62 -0
- package/dist/templates/help/src/components/ui/textarea.tsx +21 -0
- package/dist/templates/help/src/data/proyectos.json +56 -0
- package/dist/templates/help/src/index.css +104 -0
- package/dist/templates/help/src/lib/queryClient.ts +11 -0
- package/dist/templates/help/src/lib/utils.ts +6 -0
- package/dist/templates/help/src/main.tsx +33 -0
- package/dist/templates/help/src/routeTree.gen.ts +241 -0
- package/dist/templates/help/src/router.tsx +13 -0
- package/dist/templates/help/src/routes/__root.tsx +92 -0
- package/dist/templates/help/src/routes/auth/iniciar-sesion.tsx +139 -0
- package/dist/templates/help/src/routes/auth/registro.tsx +205 -0
- package/dist/templates/help/src/routes/contacto.tsx +60 -0
- package/dist/templates/help/src/routes/dashbord.tsx +9 -0
- package/dist/templates/help/src/routes/documentacion.tsx +80 -0
- package/dist/templates/help/src/routes/index.test.tsx +42 -0
- package/dist/templates/help/src/routes/index.tsx +211 -0
- package/dist/templates/help/src/routes/perfil.tsx +9 -0
- package/dist/templates/help/src/routes/proyectos.$proyectoId.tsx +156 -0
- package/dist/templates/help/src/routes/proyectos.tsx +93 -0
- package/dist/templates/help/src/test/setup.ts +1 -0
- package/dist/templates/help/tsconfig.app.json +34 -0
- package/dist/templates/help/tsconfig.json +10 -0
- package/dist/templates/help/tsconfig.node.json +26 -0
- package/dist/templates/help/vite.config.ts +22 -0
- package/dist/templates/help/vitest.config.ts +9 -0
- package/dist/test-cli.js +48 -0
- package/package.json +25 -0
- package/templates/clean/.cursor/skills/architecture/SKILL.md +26 -0
- package/templates/clean/.cursor/skills/components-shadcn/SKILL.md +23 -0
- package/templates/clean/.cursor/skills/daisyui/SKILL.md +98 -0
- package/templates/clean/.cursor/skills/routing/SKILL.md +32 -0
- package/templates/clean/.cursor/skills/testing/SKILL.md +55 -0
- package/templates/clean/.cursor/skills/tooling-and-scripts/SKILL.md +24 -0
- package/templates/clean/.cursor/skills/ui-and-styling/SKILL.md +32 -0
- package/templates/clean/.cursor/skills/vibe-and-ia/SKILL.md +23 -0
- package/templates/clean/.prettierrc +6 -0
- package/templates/clean/.tanstack/tmp/c28007bb-2319511cf318e28129c8d8eb723db5fd +9 -0
- package/templates/clean/.tanstack/tmp/c28007bb-bcef89e9e4593777e1c15ec4b4f32eea +9 -0
- package/templates/clean/.vscode/extensions.json +7 -0
- package/templates/clean/README.md +75 -0
- package/templates/clean/components.json +22 -0
- package/templates/clean/eslint.config.js +31 -0
- package/templates/clean/index.html +13 -0
- package/templates/clean/package.json +62 -0
- package/templates/clean/pnpm-lock.yaml +4487 -0
- package/templates/clean/pnpm-workspace.yaml +2 -0
- package/templates/clean/src/assets/react.svg +1 -0
- package/templates/clean/src/components/ui/badge.tsx +37 -0
- package/templates/clean/src/components/ui/breadcrumb.tsx +106 -0
- package/templates/clean/src/components/ui/button.tsx +58 -0
- package/templates/clean/src/components/ui/card.tsx +72 -0
- package/templates/clean/src/components/ui/form.tsx +165 -0
- package/templates/clean/src/components/ui/input.tsx +22 -0
- package/templates/clean/src/components/ui/label.tsx +24 -0
- package/templates/clean/src/components/ui/password-input.tsx +41 -0
- package/templates/clean/src/components/ui/separator.tsx +28 -0
- package/templates/clean/src/components/ui/tabs.tsx +62 -0
- package/templates/clean/src/components/ui/textarea.tsx +21 -0
- package/templates/clean/src/index.css +104 -0
- package/templates/clean/src/lib/queryClient.ts +11 -0
- package/templates/clean/src/lib/utils.ts +6 -0
- package/templates/clean/src/main.tsx +33 -0
- package/templates/clean/src/routeTree.gen.ts +77 -0
- package/templates/clean/src/router.tsx +13 -0
- package/templates/clean/src/routes/__root.tsx +82 -0
- package/templates/clean/src/routes/index.tsx +187 -0
- package/templates/clean/src/routes/otra-ruta.tsx +319 -0
- package/templates/clean/src/test/setup.ts +1 -0
- package/templates/clean/tsconfig.app.json +34 -0
- package/templates/clean/tsconfig.json +10 -0
- package/templates/clean/tsconfig.node.json +26 -0
- package/templates/clean/vite.config.ts +22 -0
- package/templates/clean/vitest.config.ts +9 -0
- package/templates/help/.cursor/skills/architecture/SKILL.md +26 -0
- package/templates/help/.cursor/skills/components-shadcn/SKILL.md +23 -0
- package/templates/help/.cursor/skills/daisyui/SKILL.md +98 -0
- package/templates/help/.cursor/skills/routing/SKILL.md +32 -0
- package/templates/help/.cursor/skills/testing/SKILL.md +55 -0
- package/templates/help/.cursor/skills/tooling-and-scripts/SKILL.md +24 -0
- package/templates/help/.cursor/skills/ui-and-styling/SKILL.md +32 -0
- package/templates/help/.cursor/skills/vibe-and-ia/SKILL.md +23 -0
- package/templates/help/.prettierrc +6 -0
- package/templates/help/.tanstack/tmp/c28007bb-2319511cf318e28129c8d8eb723db5fd +9 -0
- package/templates/help/.tanstack/tmp/c28007bb-bcef89e9e4593777e1c15ec4b4f32eea +9 -0
- package/templates/help/.vscode/extensions.json +7 -0
- package/templates/help/README.md +75 -0
- package/templates/help/components.json +22 -0
- package/templates/help/eslint.config.js +31 -0
- package/templates/help/index.html +13 -0
- package/templates/help/package.json +62 -0
- package/templates/help/pnpm-lock.yaml +4487 -0
- package/templates/help/pnpm-workspace.yaml +2 -0
- package/templates/help/src/assets/react.svg +1 -0
- package/templates/help/src/components/documentacion/entorno.tsx +99 -0
- package/templates/help/src/components/documentacion/estructura.tsx +100 -0
- package/templates/help/src/components/documentacion/figma-mcp.tsx +200 -0
- package/templates/help/src/components/documentacion/inicio.tsx +69 -0
- package/templates/help/src/components/documentacion/instalacion.tsx +72 -0
- package/templates/help/src/components/documentacion/personalizacion.tsx +163 -0
- package/templates/help/src/components/documentacion/rutas.tsx +138 -0
- package/templates/help/src/components/documentacion/stack.tsx +401 -0
- package/templates/help/src/components/ui/badge.tsx +37 -0
- package/templates/help/src/components/ui/breadcrumb.tsx +106 -0
- package/templates/help/src/components/ui/button.tsx +58 -0
- package/templates/help/src/components/ui/card.tsx +72 -0
- package/templates/help/src/components/ui/form.tsx +165 -0
- package/templates/help/src/components/ui/input.tsx +22 -0
- package/templates/help/src/components/ui/label.tsx +24 -0
- package/templates/help/src/components/ui/password-input.tsx +41 -0
- package/templates/help/src/components/ui/separator.tsx +28 -0
- package/templates/help/src/components/ui/tabs.tsx +62 -0
- package/templates/help/src/components/ui/textarea.tsx +21 -0
- package/templates/help/src/data/proyectos.json +56 -0
- package/templates/help/src/index.css +104 -0
- package/templates/help/src/lib/queryClient.ts +11 -0
- package/templates/help/src/lib/utils.ts +6 -0
- package/templates/help/src/main.tsx +33 -0
- package/templates/help/src/routeTree.gen.ts +241 -0
- package/templates/help/src/router.tsx +13 -0
- package/templates/help/src/routes/__root.tsx +92 -0
- package/templates/help/src/routes/auth/iniciar-sesion.tsx +139 -0
- package/templates/help/src/routes/auth/registro.tsx +205 -0
- package/templates/help/src/routes/contacto.tsx +60 -0
- package/templates/help/src/routes/dashbord.tsx +9 -0
- package/templates/help/src/routes/documentacion.tsx +80 -0
- package/templates/help/src/routes/index.test.tsx +42 -0
- package/templates/help/src/routes/index.tsx +211 -0
- package/templates/help/src/routes/perfil.tsx +9 -0
- package/templates/help/src/routes/proyectos.$proyectoId.tsx +156 -0
- package/templates/help/src/routes/proyectos.tsx +93 -0
- package/templates/help/src/test/setup.ts +1 -0
- package/templates/help/tsconfig.app.json +34 -0
- package/templates/help/tsconfig.json +10 -0
- package/templates/help/tsconfig.node.json +26 -0
- package/templates/help/vite.config.ts +22 -0
- package/templates/help/vitest.config.ts +9 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { mkdir, cp, rm } from "fs/promises";
|
|
3
|
+
import path from "path";
|
|
4
|
+
import process from "process";
|
|
5
|
+
import prompts from "prompts";
|
|
6
|
+
import { execSync } from "child_process";
|
|
7
|
+
import { fileURLToPath } from "url";
|
|
8
|
+
const TEMPLATES = {
|
|
9
|
+
clean: "clean",
|
|
10
|
+
help: "help",
|
|
11
|
+
};
|
|
12
|
+
// Cross-platform __dirname
|
|
13
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
14
|
+
// Helpers
|
|
15
|
+
function commandExists(cmd) {
|
|
16
|
+
try {
|
|
17
|
+
execSync(`${cmd} --version`, { stdio: "ignore" });
|
|
18
|
+
return true;
|
|
19
|
+
}
|
|
20
|
+
catch {
|
|
21
|
+
return false;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
function installPnpm() {
|
|
25
|
+
const platform = process.platform;
|
|
26
|
+
console.log("📦 Installing pnpm...");
|
|
27
|
+
if (platform === "win32") {
|
|
28
|
+
execSync("corepack enable", { stdio: "inherit" });
|
|
29
|
+
execSync("corepack prepare pnpm@latest --activate", { stdio: "inherit" });
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
execSync("curl -fsSL https://get.pnpm.io/install.sh | sh -", {
|
|
33
|
+
stdio: "inherit",
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
async function main() {
|
|
37
|
+
let targetDir = "";
|
|
38
|
+
try {
|
|
39
|
+
const response = await prompts([
|
|
40
|
+
{
|
|
41
|
+
type: "text",
|
|
42
|
+
name: "projectName",
|
|
43
|
+
message: "Project name",
|
|
44
|
+
initial: "huenei-frontend",
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
type: "select",
|
|
48
|
+
name: "variant",
|
|
49
|
+
message: "Select template version",
|
|
50
|
+
choices: [
|
|
51
|
+
{ title: "help-version", value: "help" },
|
|
52
|
+
{ title: "clean-version", value: "clean" },
|
|
53
|
+
],
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
type: "confirm",
|
|
57
|
+
name: "checkPnpm",
|
|
58
|
+
message: "Check / install pnpm?",
|
|
59
|
+
initial: true,
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
type: "confirm",
|
|
63
|
+
name: "installDeps",
|
|
64
|
+
message: "Install dependencies now?",
|
|
65
|
+
initial: true,
|
|
66
|
+
},
|
|
67
|
+
], {
|
|
68
|
+
onCancel: async () => {
|
|
69
|
+
console.log("\n⚠️ Cancelled by user");
|
|
70
|
+
if (targetDir)
|
|
71
|
+
await rm(targetDir, { recursive: true, force: true });
|
|
72
|
+
process.exit(1);
|
|
73
|
+
},
|
|
74
|
+
});
|
|
75
|
+
const { projectName, variant, checkPnpm, installDeps } = response;
|
|
76
|
+
if (!projectName || !variant)
|
|
77
|
+
throw new Error("Invalid input");
|
|
78
|
+
if (checkPnpm && !commandExists("pnpm"))
|
|
79
|
+
installPnpm();
|
|
80
|
+
targetDir = path.resolve(process.cwd(), projectName);
|
|
81
|
+
await mkdir(targetDir, { recursive: true });
|
|
82
|
+
const templateDir = path.resolve(__dirname, "../templates", TEMPLATES[variant]);
|
|
83
|
+
await cp(templateDir, targetDir, { recursive: true });
|
|
84
|
+
if (installDeps) {
|
|
85
|
+
console.log("📦 Installing dependencies...");
|
|
86
|
+
execSync("pnpm install", { cwd: targetDir, stdio: "inherit" });
|
|
87
|
+
}
|
|
88
|
+
console.log("\n✔ Project ready");
|
|
89
|
+
console.log(`👉 cd ${projectName}`);
|
|
90
|
+
console.log("👉 pnpm dev");
|
|
91
|
+
}
|
|
92
|
+
catch (err) {
|
|
93
|
+
console.error(`\n❌ Error: ${err.message || err}`);
|
|
94
|
+
if (targetDir)
|
|
95
|
+
await rm(targetDir, { recursive: true, force: true });
|
|
96
|
+
process.exit(1);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
main();
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Project architecture and structure
|
|
3
|
+
alwaysApply: true
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Arquitectura del proyecto
|
|
7
|
+
|
|
8
|
+
- React 19 + TypeScript obligatorio.
|
|
9
|
+
- Vite como build tool.
|
|
10
|
+
- pnpm como gestor recomendado.
|
|
11
|
+
|
|
12
|
+
## Estructura
|
|
13
|
+
|
|
14
|
+
- `src/routes` → pantallas y navegación (TanStack Router).
|
|
15
|
+
- `src/components` → componentes reutilizables.
|
|
16
|
+
- `src/components/ui` → shadcn/ui sin lógica de negocio.
|
|
17
|
+
- `src/lib` → helpers y utilidades.
|
|
18
|
+
- `src/data` → datos estáticos.
|
|
19
|
+
- `src/assets` → recursos estáticos.
|
|
20
|
+
|
|
21
|
+
## Reglas
|
|
22
|
+
|
|
23
|
+
- Pantallas = rutas.
|
|
24
|
+
- Componentes visuales sin lógica.
|
|
25
|
+
- Lógica fuera del layout.
|
|
26
|
+
- No crear estructuras nuevas sin necesidad.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: shadcn/ui usage rules
|
|
3
|
+
alwaysApply: true
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Componentes shadcn/ui
|
|
7
|
+
|
|
8
|
+
## Uso
|
|
9
|
+
|
|
10
|
+
- Importar desde @/components/ui
|
|
11
|
+
- Usar shadcn como base visual
|
|
12
|
+
|
|
13
|
+
## Reglas
|
|
14
|
+
|
|
15
|
+
- No modificar componentes base
|
|
16
|
+
- Extender solo vía composición
|
|
17
|
+
- Componentes UI sin lógica de negocio
|
|
18
|
+
- Mantener consistencia visual
|
|
19
|
+
|
|
20
|
+
## Instalación de nuevos componentes
|
|
21
|
+
|
|
22
|
+
- Usar el CLI oficial de shadcn
|
|
23
|
+
- No copiar código manualmente
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: DaisyUI semantic colors strictly coupled to shadcn/ui components
|
|
3
|
+
alwaysApply: true
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# DaisyUI + shadcn/ui – Reglas obligatorias
|
|
7
|
+
|
|
8
|
+
## Principio fundamental
|
|
9
|
+
|
|
10
|
+
DaisyUI **NO define componentes** en este proyecto.
|
|
11
|
+
DaisyUI **SOLO define tokens semánticos de color y theme**.
|
|
12
|
+
|
|
13
|
+
Los componentes visuales **siempre** provienen de:
|
|
14
|
+
src/components/ui (shadcn/ui)
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## Uso de DaisyUI
|
|
19
|
+
|
|
20
|
+
### Permitido
|
|
21
|
+
|
|
22
|
+
- Usar **únicamente** clases semánticas de color:
|
|
23
|
+
|
|
24
|
+
- bg-primary / text-primary / border-primary
|
|
25
|
+
- bg-secondary / text-secondary
|
|
26
|
+
- bg-accent
|
|
27
|
+
- bg-neutral
|
|
28
|
+
- bg-base-100 / bg-base-200 / bg-base-300
|
|
29
|
+
- text-base-content
|
|
30
|
+
|
|
31
|
+
- Usar DaisyUI para:
|
|
32
|
+
- theming
|
|
33
|
+
- color tokens
|
|
34
|
+
- soporte dark/light vía theme
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
## Prohibiciones absolutas
|
|
39
|
+
|
|
40
|
+
- No usar componentes DaisyUI:
|
|
41
|
+
- btn
|
|
42
|
+
- card
|
|
43
|
+
- badge
|
|
44
|
+
- alert
|
|
45
|
+
- modal
|
|
46
|
+
- tabs
|
|
47
|
+
- No importar estilos o markup de DaisyUI components.
|
|
48
|
+
- No recrear componentes shadcn usando clases DaisyUI.
|
|
49
|
+
- No usar colores hardcodeados:
|
|
50
|
+
- bg-blue-\*
|
|
51
|
+
- text-red-\*
|
|
52
|
+
- border-green-\*
|
|
53
|
+
- No usar valores hex, rgb, hsl u oklch en clases.
|
|
54
|
+
- No usar clases arbitrarias de color.
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
## Relación con shadcn/ui
|
|
59
|
+
|
|
60
|
+
- Todo componente visual debe existir en:
|
|
61
|
+
src/components/ui
|
|
62
|
+
- Si un componente no existe:
|
|
63
|
+
- primero se crea como shadcn-compatible
|
|
64
|
+
- luego se le aplican tokens DaisyUI
|
|
65
|
+
- DaisyUI **nunca reemplaza** a shadcn/ui
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
## Integración con Tailwind
|
|
70
|
+
|
|
71
|
+
- Tailwind se usa para:
|
|
72
|
+
- layout
|
|
73
|
+
- spacing
|
|
74
|
+
- tipografía
|
|
75
|
+
- DaisyUI controla:
|
|
76
|
+
- colores
|
|
77
|
+
- contrastes
|
|
78
|
+
- themes
|
|
79
|
+
- shadcn/ui controla:
|
|
80
|
+
- estructura
|
|
81
|
+
- accesibilidad
|
|
82
|
+
- variantes
|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
|
|
86
|
+
## Estados
|
|
87
|
+
|
|
88
|
+
- Usar tokens, no colores:
|
|
89
|
+
- hover:bg-primary-focus
|
|
90
|
+
- active:bg-primary-focus
|
|
91
|
+
- disabled:bg-base-200
|
|
92
|
+
|
|
93
|
+
---
|
|
94
|
+
|
|
95
|
+
## Regla final
|
|
96
|
+
|
|
97
|
+
Si un componente existe en shadcn/ui, **siempre** debe usarse.
|
|
98
|
+
Si DaisyUI ofrece algo similar, **se ignora**.
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: TanStack Router rules
|
|
3
|
+
alwaysApply: true
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Routing (TanStack Router)
|
|
7
|
+
|
|
8
|
+
## Principios
|
|
9
|
+
|
|
10
|
+
- Usar exclusivamente file-based routing
|
|
11
|
+
- Las rutas viven en src/routes
|
|
12
|
+
- La URL es fuente de verdad
|
|
13
|
+
|
|
14
|
+
## Definición de ruta
|
|
15
|
+
|
|
16
|
+
- Usar createFileRoute
|
|
17
|
+
- Un componente por archivo
|
|
18
|
+
|
|
19
|
+
## Rutas dinámicas
|
|
20
|
+
|
|
21
|
+
- Usar prefijo $ en el nombre del archivo
|
|
22
|
+
- Leer params con Route.useParams()
|
|
23
|
+
|
|
24
|
+
## Navegación
|
|
25
|
+
|
|
26
|
+
- Usar Link de @tanstack/react-router
|
|
27
|
+
- No usar useNavigate directamente
|
|
28
|
+
|
|
29
|
+
## Restricciones
|
|
30
|
+
|
|
31
|
+
- No usar useEffect para sincronizar URL o params
|
|
32
|
+
- Loaders y actions solo para datos
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Testing rules with Vitest and React Testing Library
|
|
3
|
+
alwaysApply: true
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Testing
|
|
7
|
+
|
|
8
|
+
## Stack
|
|
9
|
+
|
|
10
|
+
- Vitest como test runner
|
|
11
|
+
- React Testing Library para testing de componentes
|
|
12
|
+
- jsdom como entorno de ejecución
|
|
13
|
+
|
|
14
|
+
## Principios
|
|
15
|
+
|
|
16
|
+
- Testear comportamiento, no implementación
|
|
17
|
+
- El test debe parecerse al uso real del usuario
|
|
18
|
+
- Priorizar claridad sobre cobertura artificial
|
|
19
|
+
|
|
20
|
+
## Reglas de React Testing Library
|
|
21
|
+
|
|
22
|
+
- Usar queries por prioridad:
|
|
23
|
+
- getByRole
|
|
24
|
+
- getByLabelText
|
|
25
|
+
- getByText
|
|
26
|
+
- Evitar:
|
|
27
|
+
- getByTestId (solo si no hay alternativa)
|
|
28
|
+
- queries por clases o estructura interna
|
|
29
|
+
|
|
30
|
+
## Componentes
|
|
31
|
+
|
|
32
|
+
- Renderizar componentes con render() de RTL
|
|
33
|
+
- No mockear componentes visuales innecesariamente
|
|
34
|
+
- Mockear solo límites externos (API, storage, router)
|
|
35
|
+
|
|
36
|
+
## Estado y efectos
|
|
37
|
+
|
|
38
|
+
- No testear estados internos directamente
|
|
39
|
+
- Verificar efectos observables en la UI
|
|
40
|
+
- Esperar cambios async con findBy\* o waitFor
|
|
41
|
+
|
|
42
|
+
## jsdom
|
|
43
|
+
|
|
44
|
+
- Asumir entorno de navegador
|
|
45
|
+
- No depender de APIs no soportadas por jsdom sin mocks
|
|
46
|
+
|
|
47
|
+
## Estructura de tests
|
|
48
|
+
|
|
49
|
+
- Un describe por unidad testeada
|
|
50
|
+
- Tests pequeños y descriptivos
|
|
51
|
+
- Evitar tests gigantes o acoplados
|
|
52
|
+
|
|
53
|
+
## Regla final
|
|
54
|
+
|
|
55
|
+
Un test que no explica qué protege, no sirve
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Tooling, scripts and configuration
|
|
3
|
+
alwaysApply: true
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Tooling y Configuración
|
|
7
|
+
|
|
8
|
+
## Scripts
|
|
9
|
+
|
|
10
|
+
- pnpm dev → desarrollo
|
|
11
|
+
- pnpm build → producción
|
|
12
|
+
- pnpm test → tests
|
|
13
|
+
|
|
14
|
+
## Archivos importantes
|
|
15
|
+
|
|
16
|
+
- vite.config.ts
|
|
17
|
+
- tsconfig.json
|
|
18
|
+
- components.json
|
|
19
|
+
- src/router.tsx
|
|
20
|
+
|
|
21
|
+
## Imports
|
|
22
|
+
|
|
23
|
+
- Usar alias @/
|
|
24
|
+
- Evitar imports relativos profundos
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: UI, layout and Tailwind rules
|
|
3
|
+
alwaysApply: true
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# UI y Estilos
|
|
7
|
+
|
|
8
|
+
## Principios
|
|
9
|
+
|
|
10
|
+
- Tailwind CSS v4 obligatorio
|
|
11
|
+
- No usar estilos inline
|
|
12
|
+
- No inventar diseño
|
|
13
|
+
- Utilizar DaisyUI para los themes
|
|
14
|
+
- Utiliza el @plugin "daisyui/theme" en el index.css para estandarizar colores que se repitan
|
|
15
|
+
|
|
16
|
+
## Fuente de verdad
|
|
17
|
+
|
|
18
|
+
- Figma define layout, spacing y jerarquía
|
|
19
|
+
- El código debe replicar Figma exactamente
|
|
20
|
+
|
|
21
|
+
## Layout
|
|
22
|
+
|
|
23
|
+
- Usar flex o grid según diseño
|
|
24
|
+
- Priorizar gap sobre margin
|
|
25
|
+
- Evitar hacks con position absolute
|
|
26
|
+
- Mobile-first
|
|
27
|
+
|
|
28
|
+
## Tipografía y colores
|
|
29
|
+
|
|
30
|
+
- Usar tokens definidos
|
|
31
|
+
- No hardcodear valores arbitrarios
|
|
32
|
+
- Mantener jerarquía tipográfica clara
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: AI behavior and vibe rules
|
|
3
|
+
alwaysApply: true
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Rol de la IA
|
|
7
|
+
|
|
8
|
+
## Comportamiento
|
|
9
|
+
|
|
10
|
+
- Cursor actúa como asistente técnico
|
|
11
|
+
- No actúa como diseñador
|
|
12
|
+
- No inventa UX, layout ni flujos
|
|
13
|
+
|
|
14
|
+
## Generación de código
|
|
15
|
+
|
|
16
|
+
- Código claro, simple y legible
|
|
17
|
+
- Respetar estructura existente
|
|
18
|
+
- No sobre-optimizar
|
|
19
|
+
- Mantener consistencia
|
|
20
|
+
|
|
21
|
+
## Regla final
|
|
22
|
+
|
|
23
|
+
Si algo no está en Figma o en estas reglas, no asumirlo
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# React + TypeScript + Vite
|
|
2
|
+
|
|
3
|
+
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
|
|
4
|
+
|
|
5
|
+
Currently, two official plugins are available:
|
|
6
|
+
|
|
7
|
+
- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Babel](https://babeljs.io/) (or [oxc](https://oxc.rs) when used in [rolldown-vite](https://vite.dev/guide/rolldown)) for Fast Refresh
|
|
8
|
+
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
|
|
9
|
+
|
|
10
|
+
## React Compiler
|
|
11
|
+
|
|
12
|
+
The React Compiler is enabled on this template. See [this documentation](https://react.dev/learn/react-compiler) for more information.
|
|
13
|
+
|
|
14
|
+
Note: This will impact Vite dev & build performances.
|
|
15
|
+
|
|
16
|
+
## Expanding the ESLint configuration
|
|
17
|
+
|
|
18
|
+
If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules:
|
|
19
|
+
|
|
20
|
+
```js
|
|
21
|
+
export default defineConfig([
|
|
22
|
+
globalIgnores(['dist']),
|
|
23
|
+
{
|
|
24
|
+
files: ['**/*.{ts,tsx}'],
|
|
25
|
+
extends: [
|
|
26
|
+
// Other configs...
|
|
27
|
+
|
|
28
|
+
// Remove tseslint.configs.recommended and replace with this
|
|
29
|
+
tseslint.configs.recommendedTypeChecked,
|
|
30
|
+
// Alternatively, use this for stricter rules
|
|
31
|
+
tseslint.configs.strictTypeChecked,
|
|
32
|
+
// Optionally, add this for stylistic rules
|
|
33
|
+
tseslint.configs.stylisticTypeChecked,
|
|
34
|
+
|
|
35
|
+
// Other configs...
|
|
36
|
+
],
|
|
37
|
+
languageOptions: {
|
|
38
|
+
parserOptions: {
|
|
39
|
+
project: ['./tsconfig.node.json', './tsconfig.app.json'],
|
|
40
|
+
tsconfigRootDir: import.meta.dirname,
|
|
41
|
+
},
|
|
42
|
+
// other options...
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
])
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
You can also install [eslint-plugin-react-x](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-x) and [eslint-plugin-react-dom](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom) for React-specific lint rules:
|
|
49
|
+
|
|
50
|
+
```js
|
|
51
|
+
// eslint.config.js
|
|
52
|
+
import reactX from 'eslint-plugin-react-x'
|
|
53
|
+
import reactDom from 'eslint-plugin-react-dom'
|
|
54
|
+
|
|
55
|
+
export default defineConfig([
|
|
56
|
+
globalIgnores(['dist']),
|
|
57
|
+
{
|
|
58
|
+
files: ['**/*.{ts,tsx}'],
|
|
59
|
+
extends: [
|
|
60
|
+
// Other configs...
|
|
61
|
+
// Enable lint rules for React
|
|
62
|
+
reactX.configs['recommended-typescript'],
|
|
63
|
+
// Enable lint rules for React DOM
|
|
64
|
+
reactDom.configs.recommended,
|
|
65
|
+
],
|
|
66
|
+
languageOptions: {
|
|
67
|
+
parserOptions: {
|
|
68
|
+
project: ['./tsconfig.node.json', './tsconfig.app.json'],
|
|
69
|
+
tsconfigRootDir: import.meta.dirname,
|
|
70
|
+
},
|
|
71
|
+
// other options...
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
])
|
|
75
|
+
```
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://ui.shadcn.com/schema.json",
|
|
3
|
+
"style": "new-york",
|
|
4
|
+
"rsc": false,
|
|
5
|
+
"tsx": true,
|
|
6
|
+
"tailwind": {
|
|
7
|
+
"config": "",
|
|
8
|
+
"css": "src/index.css",
|
|
9
|
+
"baseColor": "neutral",
|
|
10
|
+
"cssVariables": true,
|
|
11
|
+
"prefix": ""
|
|
12
|
+
},
|
|
13
|
+
"iconLibrary": "lucide",
|
|
14
|
+
"aliases": {
|
|
15
|
+
"components": "@/components",
|
|
16
|
+
"utils": "@/lib/utils",
|
|
17
|
+
"ui": "@/components/ui",
|
|
18
|
+
"lib": "@/lib",
|
|
19
|
+
"hooks": "@/hooks"
|
|
20
|
+
},
|
|
21
|
+
"registries": {}
|
|
22
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import js from "@eslint/js";
|
|
2
|
+
import globals from "globals";
|
|
3
|
+
import tseslint from "typescript-eslint";
|
|
4
|
+
import reactHooks from "eslint-plugin-react-hooks";
|
|
5
|
+
import reactRefresh from "eslint-plugin-react-refresh";
|
|
6
|
+
import prettier from "eslint-config-prettier";
|
|
7
|
+
import { defineConfig, globalIgnores } from "eslint/config";
|
|
8
|
+
|
|
9
|
+
export default defineConfig([
|
|
10
|
+
globalIgnores(["dist", "node_modules"]),
|
|
11
|
+
|
|
12
|
+
{
|
|
13
|
+
files: ["**/*.{ts,tsx}"],
|
|
14
|
+
languageOptions: {
|
|
15
|
+
ecmaVersion: "latest",
|
|
16
|
+
sourceType: "module",
|
|
17
|
+
globals: globals.browser,
|
|
18
|
+
},
|
|
19
|
+
extends: [
|
|
20
|
+
js.configs.recommended,
|
|
21
|
+
...tseslint.configs.recommended,
|
|
22
|
+
reactHooks.configs.flat.recommended,
|
|
23
|
+
reactRefresh.configs.vite,
|
|
24
|
+
prettier,
|
|
25
|
+
],
|
|
26
|
+
rules: {
|
|
27
|
+
"@typescript-eslint/no-unused-vars": ["warn", { argsIgnorePattern: "^_" }],
|
|
28
|
+
"@typescript-eslint/no-explicit-any": "error",
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
]);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en" data-theme="huenei">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
|
+
<title>frontend-template</title>
|
|
8
|
+
</head>
|
|
9
|
+
<body>
|
|
10
|
+
<div id="root"></div>
|
|
11
|
+
<script type="module" src="/src/main.tsx"></script>
|
|
12
|
+
</body>
|
|
13
|
+
</html>
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "frontend-template",
|
|
3
|
+
"private": true,
|
|
4
|
+
"version": "0.0.0",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"dev": "vite",
|
|
8
|
+
"build": "tsc -b && vite build",
|
|
9
|
+
"lint": "eslint .",
|
|
10
|
+
"preview": "vite preview",
|
|
11
|
+
"test": "vitest"
|
|
12
|
+
},
|
|
13
|
+
"dependencies": {
|
|
14
|
+
"@hookform/resolvers": "^5.2.2",
|
|
15
|
+
"@radix-ui/react-label": "^2.1.8",
|
|
16
|
+
"@radix-ui/react-separator": "^1.1.8",
|
|
17
|
+
"@radix-ui/react-slot": "^1.2.4",
|
|
18
|
+
"@radix-ui/react-tabs": "^1.1.13",
|
|
19
|
+
"@tailwindcss/vite": "^4.1.18",
|
|
20
|
+
"@tanstack/react-query": "^5.90.16",
|
|
21
|
+
"@tanstack/react-router": "^1.149.3",
|
|
22
|
+
"@tanstack/react-router-devtools": "^1.149.3",
|
|
23
|
+
"class-variance-authority": "^0.7.1",
|
|
24
|
+
"clsx": "^2.1.1",
|
|
25
|
+
"lucide-react": "^0.562.0",
|
|
26
|
+
"react": "^19.2.0",
|
|
27
|
+
"react-dom": "^19.2.0",
|
|
28
|
+
"react-hook-form": "^7.71.0",
|
|
29
|
+
"react-toastify": "^11.0.5",
|
|
30
|
+
"tailwind-merge": "^3.4.0",
|
|
31
|
+
"tailwindcss": "^4.1.18",
|
|
32
|
+
"zod": "^4.3.5"
|
|
33
|
+
},
|
|
34
|
+
"devDependencies": {
|
|
35
|
+
"@eslint/js": "^9.39.1",
|
|
36
|
+
"@tanstack/react-query-devtools": "^5.91.2",
|
|
37
|
+
"@tanstack/router-plugin": "^1.149.3",
|
|
38
|
+
"@testing-library/jest-dom": "^6.9.1",
|
|
39
|
+
"@testing-library/react": "^16.3.1",
|
|
40
|
+
"@types/jsdom": "^27.0.0",
|
|
41
|
+
"@types/node": "^24.10.1",
|
|
42
|
+
"@types/react": "^19.2.5",
|
|
43
|
+
"@types/react-dom": "^19.2.3",
|
|
44
|
+
"@vitejs/plugin-react": "^5.1.1",
|
|
45
|
+
"@vitest/ui": "^4.0.17",
|
|
46
|
+
"babel-plugin-react-compiler": "^1.0.0",
|
|
47
|
+
"daisyui": "^5.5.14",
|
|
48
|
+
"eslint": "^9.39.1",
|
|
49
|
+
"eslint-plugin-react-hooks": "^7.0.1",
|
|
50
|
+
"eslint-plugin-react-refresh": "^0.4.24",
|
|
51
|
+
"globals": "^16.5.0",
|
|
52
|
+
"jsdom": "^27.4.0",
|
|
53
|
+
"tw-animate-css": "^1.4.0",
|
|
54
|
+
"typescript": "~5.9.3",
|
|
55
|
+
"typescript-eslint": "^8.46.4",
|
|
56
|
+
"vite": "npm:rolldown-vite@7.2.5",
|
|
57
|
+
"vitest": "^4.0.17"
|
|
58
|
+
},
|
|
59
|
+
"overrides": {
|
|
60
|
+
"vite": "npm:rolldown-vite@7.2.5"
|
|
61
|
+
}
|
|
62
|
+
}
|