feat(F-141): completed feature

This commit is contained in:
chattie
2026-08-21 22:02:01 +02:00
parent 0a1d32ecc3
commit 022347349d
17 changed files with 253 additions and 31 deletions

View File

@@ -1,6 +1,14 @@
import type { NextConfig } from "next";
import { dirname } from 'node:path';
import { fileURLToPath } from 'node:url';
import type { NextConfig } from 'next';
const frontendRoot = dirname(fileURLToPath(import.meta.url));
const nextConfig: NextConfig = {
turbopack: {
root: frontendRoot,
},
outputFileTracingRoot: frontendRoot,
images: {
remotePatterns: [
{ protocol: 'https', hostname: '**' },

View File

@@ -1,6 +1,9 @@
import type { Metadata } from 'next';
import { fetchProducts } from '@/lib/api';
// This legacy admin route depends on the live catalog API.
export const dynamic = 'force-dynamic';
export const metadata: Metadata = {
title: 'Admin Productos — mercadodevida',
};

View File

@@ -4,8 +4,8 @@ import type { Metadata } from 'next';
import { fetchBrandBySlug, fetchProducts, formatPrice } from '@/lib/api';
import { formatRichText } from '@/lib/format-rich-text';
// ISR para fichas de marca (F-132).
export const revalidate = 3600;
// Brand data comes from the live backend; resolve it at request time.
export const dynamic = 'force-dynamic';
interface Props {
params: Promise<{ slug: string }>;

View File

@@ -3,8 +3,8 @@ import type { Metadata } from 'next';
import { fetchBrands } from '@/lib/api';
import { CmsBlock } from '@/components/content/CmsBlock';
// ISR para /brands (F-132).
export const revalidate = 3600;
// The catalog is served by the live backend; never fetch it during build.
export const dynamic = 'force-dynamic';
export const metadata: Metadata = {
title: 'Marcas — mercadodevida',

View File

@@ -4,8 +4,8 @@ import type { Metadata } from 'next';
import { fetchCategoryBySlug, fetchProducts, fetchBrands } from '@/lib/api';
import { formatRichText } from '@/lib/format-rich-text';
// ISR para fichas de categoría (F-132).
export const revalidate = 3600;
// Category data comes from the live backend; resolve it at request time.
export const dynamic = 'force-dynamic';
interface Props {
params: Promise<{ slug: string }>;

View File

@@ -3,8 +3,9 @@ import type { Metadata } from 'next';
import { fetchCategories } from '@/lib/api';
import { CmsBlock } from '@/components/content/CmsBlock';
// ISR para /categories (F-132).
export const revalidate = 3600;
// Categories depend on the live catalog API. Do not call the API during
// production builds: the backend may be deployed separately or unavailable.
export const dynamic = 'force-dynamic';
export const metadata: Metadata = {
title: 'Categorías — mercadodevida',

View File

@@ -4,7 +4,8 @@ import CategoriesGrid from '@/components/home/CategoriesGrid';
import BrandsSection from '@/components/home/BrandsSection';
import { CmsBlock } from '@/components/content/CmsBlock';
export const revalidate = 3600; // ISR: revalidate every hour
// Home sections load catalog/CMS data from the live backend.
export const dynamic = 'force-dynamic';
export default async function HomePage() {
return (

View File

@@ -15,8 +15,8 @@ import ProductAddToCart from '@/components/cart/ProductAddToCart';
import ProductAttributes from '@/components/product/ProductAttributes';
import { formatRichText } from '@/lib/format-rich-text';
// ISR para fichas de producto (F-132).
export const revalidate = 3600;
// Product data comes from the live backend; resolve it at request time.
export const dynamic = 'force-dynamic';
interface Props {
params: Promise<{ slug: string }>;

View File

@@ -5,9 +5,8 @@ import { fetchProducts, fetchBrands, fetchCategories, formatPrice } from '@/lib/
import { formatRichText } from '@/lib/format-rich-text';
import { CmsBlock } from '@/components/content/CmsBlock';
// ISR: revalidar listado cada hora para que la home / productos reflejen
// cambios del catálogo sin necesidad de redeploy (F-132).
export const revalidate = 3600;
// The catalog is served by the live backend; never fetch it during build.
export const dynamic = 'force-dynamic';
export const metadata: Metadata = {
title: 'Productos — mercadodevida',