v0.7: shop storefront + routed app

AppRouter replaces the single-page App as the mounted root: shop routes
(/ and /shop → ShopHome, /shop/:productSlug → ProductPage, /cart →
CartStub, /customize → CustomizeRoute) plus the template-manager admin
surfaces (/admin/templates|products|featured|trash, v0.8 adds
/admin/inventory + RequireAdmin wrapping). App.jsx stays on disk one
release as the documented legacy fallback — nothing imports it.

New shop UI: components/shop/ (ShopHome/Hero/ProductGrid/ProductCard/
ProductPage/ProductGallery/ProductInfo/ProductBuyPanel/CartStub/
ShopHeader/TemplateGalleryForProduct), hooks (useShopProducts/
useShopProduct/useCart/useFacetCatalog), and shop.css + admin.css.

Header gains the module-gated Clear button (onCanClearChange /
onElementCountChange mirror the editor module's history-commit
signals); i18n keys follow. vite proxies /products to the Node server
(template-manager serves product imagery — without it the SPA fallback
returns index.html as an image) and adds a template-manager chunk.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
khalid@traclabs.com
2026-09-01 23:28:58 -05:00
parent aba2dbedfb
commit 6599a5e68f
23 changed files with 5928 additions and 41 deletions

View File

@@ -289,6 +289,13 @@ export default defineConfig({
'/api': { target: 'http://localhost:3001', changeOrigin: true },
'/uploads': { target: 'http://localhost:3001', changeOrigin: true },
'/exports': { target: 'http://localhost:3001', changeOrigin: true },
// v0.7.4 — product images (gallery photos + per-size mockups)
// are served by template-manager mounted on the Node server
// (port 3001). Without this proxy, browser <img src="/products/...">
// requests hit Vite's SPA fallback and return index.html as an
// image, breaking the shop product grid, product gallery, and
// admin size cards.
'/products': { target: 'http://localhost:3001', changeOrigin: true },
},
},
build: {
@@ -390,6 +397,7 @@ export default defineConfig({
['react-vendor', 'react', 'react-dom'],
['filerobot', 'react-filerobot-image-editor'],
['goods-editor', 'goods-editor'],
['template-manager', 'template-manager'],
];
for (const [chunk, ...packages] of groups) {
for (const pkg of packages) {