Compare commits

..
Author SHA1 Message Date
devopsandClaude Sonnet 5 206571627b fix(ecommerce): forzar renderizado dinamico en home y layout raiz
Build and Push Frontend / Escaneo de Secretos (Gitleaks) (pull_request) Successful in 29s
Build and Push Frontend / Construir y Subir Imagen (pull_request) Skipped
Bug preexistente (no introducido en esta sesion, solo expuesto): "/" se
prerenderizaba en build time dentro del Dockerfile, donde
HEADLESS_PROVIDER/MEDUSA_* no existen todavia (solo se inyectan en runtime
via el Deployment de k8s) -- el provider caia a "mock" y ese HTML quedaba
cacheado 1 año (confirmado en vivo: x-nextjs-prerender:1,
Cache-Control: s-maxage=31536000, x-nextjs-cache:HIT). El carrusel de
"Novedades" del home ya mostraba productos mock desde antes; recien se
noto con el nav data-driven de la sub-fase 2 porque las categorias mock
("Figuras"/"Peluches"/"Mochilas") son obviamente distintas a las reales.
/catalog y /product/[slug] no sufren esto porque ya son dinamicos
(searchParams / params fuerzan SSR).

export const dynamic = "force-dynamic" en app/page.tsx y app/layout.tsx
(el layout comparte el fetch del Navbar con TODAS las rutas -- forzarlo
ahi tambien protege contra que una pagina futura reintroduzca el mismo
bug). Decision del usuario: priorizar datos reales sobre el cacheo
estatico de 1 año.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013dunTcReWMKhWgCPkvAVHD
2026-08-24 23:42:57 -05:00
devops d64218f45f chore: release v1.0.141 [skip ci] 2026-08-25 04:03:03 +00:00
devops 7695ca0dea Merge pull request 'fix(ecommerce): tipar defaultTile igual que las entradas de tileContent' (#34) from fix/etapa2-subfase2-category-tiles-type into main
Build and Push Frontend / Escaneo de Secretos (Gitleaks) (push) Successful in 28s
Build and Push Frontend / Construir y Subir Imagen (push) Successful in 21m58s
2026-08-25 03:40:36 +00:00
devopsandClaude Sonnet 5 bd956328db fix(ecommerce): tipar defaultTile igual que las entradas de tileContent
Build and Push Frontend / Escaneo de Secretos (Gitleaks) (pull_request) Successful in 49s
Build and Push Frontend / Construir y Subir Imagen (pull_request) Skipped
next build fallaba en tsc: defaultTile no tenia la propiedad opcional
image, asi que la union de tipos entre tileContent[handle] y defaultTile
perdia esa propiedad y content.image no compilaba. Se extrae el tipo
TileContent y se anota defaultTile con el, igual que tileContent.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013dunTcReWMKhWgCPkvAVHD
2026-08-24 22:37:24 -05:00
devops 20bc559a6c Merge pull request 'fix(ci): actualizar guard de navegacion del catalogo tras PR #32' (#33) from fix/etapa2-subfase2-ci-nav-check into main
Build and Push Frontend / Escaneo de Secretos (Gitleaks) (push) Successful in 22s
Build and Push Frontend / Construir y Subir Imagen (push) Failing after 12m14s
2026-08-25 03:17:24 +00:00
devopsandClaude Sonnet 5 2abfec57ae fix(ci): actualizar guard de navegacion del catalogo tras PR #32
Build and Push Frontend / Escaneo de Secretos (Gitleaks) (pull_request) Successful in 30s
Build and Push Frontend / Construir y Subir Imagen (pull_request) Skipped
El guard de "Validar navegación real del catálogo" en build.yaml seguia
pinneado a la implementacion vieja de navbar.tsx: greppeaba literalmente
"collection=Marvel", "category=Mochilas" y "currentCollection", que eran
exactamente los valores hardcodeados que PR #32 elimino por estar rotos
(ya no correspondian a ningun dato real desde que se quito
legacyProductMeta en PR #29). El guard quedo validando el bug, no la
correccion, y bloqueo el build post-merge de PR #32.

Ahora valida el comportamiento real nuevo: que el nav arma su arbol
desde datos reales (buildCategoryTree), que linkea por nombre real de
categoria (encodeURIComponent(root.name)) y que expone el item activo
(aria-current={isActive(...)}). El check de remontaje en
app/catalog/page.tsx tambien se actualizo: la key ya no incluye
":${section}" porque ese query param nunca se usaba (dead code
eliminado en PR #32).

Co-Authored-By: Claude Sonnet 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013dunTcReWMKhWgCPkvAVHD
2026-08-24 21:36:36 -05:00
devops f1f5f3612b Merge pull request 'fix(ecommerce): nav y tiles data-driven contra la jerarquia real de categorias' (#32) from fix/etapa2-subfase2-navegacion-datadriven into main
Build and Push Frontend / Escaneo de Secretos (Gitleaks) (push) Successful in 22s
Build and Push Frontend / Construir y Subir Imagen (push) Failing after 23s
2026-08-25 02:27:18 +00:00
5 changed files with 33 additions and 14 deletions

No files matched your search

+14 -11
View File
@@ -214,22 +214,25 @@ jobs:
exit 1
}
grep -q 'currentCollection' "${NAVBAR_FILE}" || {
echo "ERROR: navbar.tsx no calcula currentCollection."
# Desde Etapa 2 sub-fase 2 (2026-08-25) el nav es data-driven
# contra el arbol real de categorias de Medusa, no un array
# hardcodeado -- esta version anterior del check no detectaba
# que "category=Mochilas"/"collection=Marvel" eran strings
# hardcodeadas que ya no correspondian a ningun dato real (rotas
# en silencio desde que se elimino legacyProductMeta, PR #29).
# "currentCollection" tampoco existe mas: las colecciones ya no
# se usan para resaltar el item activo del menu de categorias.
grep -q 'buildCategoryTree' "${NAVBAR_FILE}" || {
echo "ERROR: navbar.tsx ya no arma el arbol de categorias desde datos reales."
exit 1
}
grep -q 'collection=Marvel' "${NAVBAR_FILE}" || {
echo "ERROR: falta collection=Marvel en navbar.tsx."
grep -q 'encodeURIComponent(root.name)' "${NAVBAR_FILE}" || {
echo "ERROR: navbar.tsx ya no linkea por el nombre real de categoria."
exit 1
}
grep -q 'category=Mochilas' "${NAVBAR_FILE}" || {
echo "ERROR: falta category=Mochilas en navbar.tsx."
exit 1
}
grep -q 'aria-current={active ? "page" : undefined}' "${NAVBAR_FILE}" || {
grep -q 'aria-current={isActive(' "${NAVBAR_FILE}" || {
echo "ERROR: navbar.tsx no expone correctamente el menú activo."
exit 1
}
@@ -258,7 +261,7 @@ jobs:
echo "Validando remontaje por parámetros: ${PAGE_FILE}"
grep -q 'key={`${category}:${collection}:${query}:${section}`}' "${PAGE_FILE}" || {
grep -q 'key={`${category}:${collection}:${query}`}' "${PAGE_FILE}" || {
echo "ERROR: app/catalog/page.tsx no remonta CatalogClient al cambiar la URL."
exit 1
}
+7
View File
@@ -6,6 +6,13 @@ import { Navbar } from "@/components/layout/navbar";
import { WishlistDrawer } from "@/components/wishlist/wishlist-drawer";
import { getCategories, getProducts } from "@/lib/headless/client";
// El Navbar (categorias/colecciones/predictive search) vive en este layout
// compartido -- si alguna pagina futura queda estatica, este fetch se
// congelaria con datos de build time (mock) igual que le paso al home
// (ver app/page.tsx). Forzarlo aca protege el nav en cualquier ruta, no
// solo en las que hoy ya son dinamicas por otro motivo (searchParams, etc.).
export const dynamic = "force-dynamic";
export const metadata: Metadata = {
metadataBase: new URL(process.env.NEXT_PUBLIC_SITE_URL ?? "https://shop.cruzcloud.net"),
title: { default: "ARI Shopping | Juguetes, regalos y variedades", template: "%s | ARI Shopping" },
+7
View File
@@ -7,6 +7,13 @@ import { ProductCarousel } from "@/components/product/product-carousel";
import { Button } from "@/components/ui/button";
import { getCategories, getProducts } from "@/lib/headless/client";
// Sin esto, Next.js prerenderiza "/" en build time dentro del Dockerfile,
// donde HEADLESS_PROVIDER/MEDUSA_* todavia no existen (solo se inyectan en
// runtime via el Deployment) -- cae al provider mock y ese HTML queda
// cacheado 1 año (visto en vivo: x-nextjs-prerender:1, s-maxage=31536000),
// violando el flujo Admin -> revalidate del ADR 0005 justo en el home.
export const dynamic = "force-dynamic";
export default async function HomePage() {
const [products, categories] = await Promise.all([getProducts(), getCategories()]);
const treasures = products.filter((product) => product.isNew || product.featured).slice(0, 8);
@@ -3,11 +3,13 @@ import Link from "next/link";
import { ArrowUpRight } from "lucide-react";
import type { Category } from "@/lib/headless/types";
type TileContent = { subtitle: string; image?: string; color: string };
// No hay fotografia real todavia para las 6 categorias raiz de la taxonomia
// (ver ADR 0005) -- solo se mapean imagen/subtitulo para las que ya tienen
// un asset en public/images/categories/. Las demas caen al tile de solo
// gradiente en vez de mostrar una imagen que no les corresponde.
const tileContent: Record<string, { subtitle: string; image?: string; color: string }> = {
const tileContent: Record<string, TileContent> = {
juguetes: { subtitle: "Personajes que inspiran", image: "/images/categories/figuras.webp", color: "from-yellow-300 to-orange-400" },
"mochilas-y-morrales": { subtitle: "Estilo para cada aventura", image: "/images/categories/mochilas.webp", color: "from-cyan-400 to-blue-500" },
"bebes-y-primera-infancia": { subtitle: "Primeros descubrimientos", color: "from-pink-300 to-fuchsia-400" },
@@ -16,7 +18,7 @@ const tileContent: Record<string, { subtitle: string; image?: string; color: str
variedades: { subtitle: "Un poco de todo", color: "from-violet-400 to-purple-600" },
};
const defaultTile = { subtitle: "Explora esta categoría", color: "from-slate-400 to-slate-600" };
const defaultTile: TileContent = { subtitle: "Explora esta categoría", color: "from-slate-400 to-slate-600" };
export function CategoryTiles({ categories }: { categories: Category[] }) {
const roots = categories.filter((category) => !category.parentId);
@@ -25,7 +25,7 @@ spec:
runAsUser: 1001
containers:
- name: app
image: gitea.cruzcloud.net/devops/ecommerce-frontend:v1.0.135
image: gitea.cruzcloud.net/devops/ecommerce-frontend:v1.0.141
env:
- name: HEADLESS_PROVIDER
value: medusa