Skip to content

Implement layered architecture#9

Closed
dlhck wants to merge 10 commits intomainfrom
refactoring
Closed

Implement layered architecture#9
dlhck wants to merge 10 commits intomainfrom
refactoring

Conversation

@dlhck
Copy link
Copy Markdown
Contributor

@dlhck dlhck commented Jan 10, 2026

Closes #7 (phases 1 & 2)

Summary

  • Set up directory structure for core/merchant separation
  • Extract theme tokens to layered CSS files
  • Upgrade Next.js to 16.1.1 and React to 19.2.3

Test plan

  • Build succeeds
  • Dark/light theme switching works
  • All pages render correctly

dlhck added 2 commits January 10, 2026 14:53
Set up directory structure for core/merchant separation:
- Add core/ for Vendure-maintained components, lib, hooks, contexts, theme
- Add merchant/ for customizable overrides and extensions
- Add config/ for storefront configuration

Extract theme tokens to layered CSS files:
- Move CSS variables to src/core/theme/base.css
- Create merchant override placeholders for tokens and components
- Update globals.css to import layered theme files

Add path aliases @core/*, @merchant/*, @config/* to tsconfig.json
@vercel
Copy link
Copy Markdown

vercel Bot commented Jan 10, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
nextjs-starter-public-demo Ready Ready Preview, Comment Jan 10, 2026 2:58pm
nextjs-starter-readonly-demo Error Error Jan 10, 2026 2:58pm

Move commerce components to src/core/components/commerce/:
- ProductCard, ProductGrid, ProductCarousel, ProductInfo
- FeaturedProducts, RelatedProducts, ProductImageCarousel
- Price, FacetFilters, SortDropdown, OrderStatusBadge

Move layout components to src/core/components/layout/:
- Navbar (with navbar/ subcomponents), Footer, HeroSection
- SearchInput, ThemeSwitcher, NavbarCart, NavbarUser, etc.

Update all imports to use @core/* path alias.
Phase 5: Extract Shared Components
- Move shared components to src/core/components/shared/
- Includes pagination, country-select, product-grid-skeleton
- Includes skeletons: cart, navbar-user, search-input, search-results

Phase 6: Extract Library Code
- Move lib/vendure/* to src/core/lib/vendure/
- Move utils.ts and format.ts to src/core/lib/
- Move contexts/auth-context.tsx to src/core/contexts/
- Move hooks/use-mobile.ts to src/core/hooks/
- Create re-export files for shadcn/ui compatibility
- Keep metadata.ts, auth.ts, search-helpers.ts as merchant-owned
- Update all imports across the codebase
dlhck added 3 commits January 10, 2026 15:40
- Move Pagination from ServerComponentRegistry to ClientComponentRegistry
  (component uses 'use client' and React hooks)
- Fix FacetFiltersProps type to use ResultOf<SearchProductsQuery> instead
  of loose typing with Array<unknown>
- Update unified registry exports to reflect correct client/server
  separation
- Add ProductCard override example in @merchant/components/overrides
- Provides customization point for merchant-specific styling
- Update app pages to import from ServerComponents and ClientComponents
- Update core components to use registry patterns for cross-component
  references
The registry file is just a re-export barrel that doesn't need 'use client'.
The individual components already have their own directives. Having
'use client' on the barrel caused server components to receive client
references instead of the actual component objects.
- Export Props interfaces from each component file
- Update registries to import Props from components instead of defining inline
- Add SearchInputProps with className support to SearchInput component
- Update merchant ProductCard override to import Props from core
Add comprehensive documentation for the layered architecture:
- CUSTOMIZATION.md: Theme, component override, and GraphQL extension guides
- UPGRADING.md: Upstream sync workflow and conflict resolution guide
@dlhck dlhck changed the title Implement layered architecture (phases 1 & 2) Implement layered architecture Jan 10, 2026
@dlhck dlhck closed this Mar 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement layered architecture for easy upstream updates

1 participant