Packages
Every package in the monorepo, with its own README. They’re consumed from the repo for now (not yet on npm); see the releases for packed builds.
| Package | What it does |
|---|---|
@mercatus-liber/account | Customer profile, order dashboard, and event-driven activity log (subsystem 10). Depends on @mercatus-liber/core only; reads orders via a narrow structural OrderLookup interface, never importing @mercatus-liber/checkout-orders directly. Auth is explicitly out of scope — bare customerId, no session/password system. |
@mercatus-liber/accounting-sync | Pushes a paid order into a real accounting/ERP system of record (epic accounting-erp-sync-adapter, traced to .pHive/planning/epic-backlog.md row 77’s ica-02 gap finding: no adapter/interface anywhere pushed a completed order into a merchant’s real accounting system). Depends on @mercatus-liber/core only; reads order data via a narrow structural interface (OrderLookup), never importing @mercatus-liber/checkout-orders directly, mirroring @mercatus-liber/fulfillment/@mercatus-liber/inventory’s own narrow-dependency discipline exactly. Owns the AccountingSyncAdapter contract every real provider adapter implements (see @mercatus-liber/adapter-quickbooks) and registerAccountingSync, which fires a sync on the real checkout.order.paid event — fire-and-forget, never blocking checkout (see src/subscriber.ts’s own doc comment for why). |
@mercatus-liber/adapter-3dapi | FulfillmentAdapter for 3DAPI, a 3D print-on-demand network with production centres in several regions: quote a file, order prints, verify webhooks. |
@mercatus-liber/adapter-clerk | AdminAuthAdapter (subsystem 21) backed by Clerk’s real Next.js + Backend SDKs. Proves admin-auth is genuinely swappable, same as adapter-sanity proved for CMS persistence. Public surface is exactly AdminAuthAdapter; depends on @mercatus-liber/admin-auth only for the types it implements, plus @clerk/nextjs as the real identity provider it wraps. Role assignment lives entirely in Clerk’s own publicMetadata — this package owns no user store of its own. |
@mercatus-liber/adapter-cloudinary | ImageAdapter (@mercatus-liber/media, image-cdn epic) backed by Cloudinary’s real, documented “fetch” delivery type: https://res.cloudinary.com/ <cloud_name>/image/fetch/ |
@mercatus-liber/adapter-convex | A real fourth reference persistence adapter (adapter-convex epic), backed by Convex — implements @mercatus-liber/core’s CatalogPersistenceAdapter interface against a real-time, TypeScript-native reactive backend, the furthest storage paradigm from adapter-sqlite/adapter-postgres/adapter-mongodb named in this project’s own roadmap. Structurally different from this repo’s other adapters: Convex requires real server-side query/mutation functions deployed to YOUR OWN Convex project (there is no generic ‘run arbitrary queries against any deployment’ client) — this package ships that real function source in convex-functions/ (copy into your project, npx convex dev/deploy) plus a client (createConvexAdapter/connectConvexAdapter) that calls those functions by name via Convex’s own real, documented makeFunctionReference mechanism (no codegen needed on this repo’s side). No live Convex account exists in this environment — built and unit-tested for real correctness against a structurally-typed fake client double (same honest-disclosure posture as adapter-shippo/adapter-printful/adapter-printify/adapter-mongodb before their first live credential). |
@mercatus-liber/adapter-mongodb | A real third reference persistence adapter (adapter-mongodb epic), backed by MongoDB — implements @mercatus-liber/core’s CatalogPersistenceAdapter interface with a genuinely different storage paradigm from adapter-sqlite/adapter-postgres (a document store, not a relational/SQL engine), proving the interface doesn’t secretly assume rows-and-columns. Public surface is exactly CatalogPersistenceAdapter — no MongoDB-specific type leaks out. Built against the official mongodb Node.js driver’s real, current API (confirmed via research, not assumed — MongoClient/db().collection()/findOne/find/updateOne with upsert). No live MongoDB account exists in this environment — built and unit-tested for real correctness against a structurally-typed fake Db double (same honest-disclosure posture as adapter-shippo/adapter-printful/adapter-printify before their first live credential). |
@mercatus-liber/adapter-paypal | PaymentAdapter (subsystem 08, @mercatus-liber/payments) backed by PayPal’s real, documented Orders v2 API — POST /v2/checkout/orders to create, POST /v2/checkout/orders/{id}/capture to capture, GET /v2/checkout/orders/{id} to read status — plus real OAuth2 client-credentials token exchange (POST /v1/oauth2/token) and real webhook-signature verification via PayPal’s own POST /v1/notifications/verify-webhook-signature endpoint. Proves PaymentAdapter is genuinely a second, provider-agnostic implementation (Stripe being the first), same shape as @mercatus-liber/adapter-postgres proved for persistence. Public surface is exactly PaymentAdapter; depends on @mercatus-liber/payments only, for the types it implements, plus global fetch as the real HTTP client (no new HTTP dependency introduced — mirrors adapter-printful/adapter-printify/adapter-shippo’s own convention). |
@mercatus-liber/adapter-postgres | Postgres persistence adapter: the catalog interfaces plus repositories for most other commerce subsystems. No pg-specific type leaks out of its public surface. |
@mercatus-liber/adapter-postgres-inventory | A real second InventoryAdapter implementation (ims-postgres-alternate epic), backed by Postgres — proves subsystem 11’s own doc comment true (“an external-IMS adapter is the same interface with a different implementation proxying to a real system”) with a genuine second backend, not just the one in-memory default @mercatus-liber/inventory ships. Public surface is exactly InventoryAdapter — no pg-specific type leaks out. Reuses the exact same DATABASE_URL/pg.Pool infrastructure @mercatus-liber/adapter-postgres already proved out for catalog persistence, so this needs no new external account beyond whatever Postgres/Supabase connection a deployment already has. Depends on @mercatus-liber/core (StockLevel/InventoryAdapter live in @mercatus-liber/inventory, referenced structurally) and @mercatus-liber/inventory for the interface it implements. |
@mercatus-liber/adapter-printful | FulfillmentAdapter (subsystem 41) backed by Printful’s real v2 order API (POST /v2/orders draft, POST /v2/orders/{id}/confirmation to confirm+charge) and v2 webhooks. Proves fulfillment is genuinely swappable to a real dropship/POD provider, same shape as adapter-clerk/adapter-shopify/adapter-sanity proved for their own subsystems. Public surface is exactly FulfillmentAdapter; depends on @mercatus-liber/fulfillment only, for the types it implements, plus global fetch as the real HTTP client (no new HTTP dependency introduced — mirrors adapter-shopify’s graphql-client.ts convention). |
@mercatus-liber/adapter-printify | FulfillmentAdapter (subsystem 41) backed by Printify’s real, current v1 order API (POST /v1/shops/{shop_id}/orders.json to create, POST …/send_to_production.json to actually charge/produce — Printify’s confirmed ‘charged only when an order moves to production’ billing model, no wallet abstraction) plus real v1 webhooks with confirmed HMAC-SHA256 X-Pfy-Signature verification. Proves fulfillment is genuinely swappable to a second, independent dropship/POD provider, same shape as adapter-printful proved for the first. Public surface is exactly FulfillmentAdapter; depends on @mercatus-liber/fulfillment only, for the types it implements, plus global fetch as the real HTTP client (no new HTTP dependency introduced — mirrors adapter-printful’s own convention) and Node’s built-in crypto for webhook signature verification. |
@mercatus-liber/adapter-quickbooks | AccountingSyncAdapter (epic accounting-erp-sync-adapter) backed by QuickBooks Online’s real v3 Accounting API (OAuth2, POST /v3/company/{realmId}/salesreceipt or /invoice) and real webhook signature verification (intuit-signature, HMAC-SHA256). Proves accounting/ERP sync is genuinely swappable to a real provider, same shape as adapter-printful/adapter-printify proved for fulfillment. Public surface is exactly AccountingSyncAdapter; depends on @mercatus-liber/accounting-sync only, for the types it implements, plus global fetch as the real HTTP client (no new HTTP dependency introduced — mirrors adapter-printful/adapter-shopify’s own convention). |
@mercatus-liber/adapter-sanity | CmsPersistenceAdapter backed by Sanity’s real Content API (Query + Mutations). Proves CMS (subsystem 05) is genuinely swappable, same as adapter-postgres/adapter-shopify proved for catalog persistence. Public surface is exactly CmsPersistenceAdapter; depends on @mercatus-liber/cms only, for the types it implements. |
@mercatus-liber/adapter-shippo | ShippingAdapter (@mercatus-liber/shipping, epic shipping-rate-and-labels) backed by Shippo’s real, current REST API: POST /shipments/ to create a Shipment and read back real carrier rates, POST /transactions/ to purchase a real label from a quoted rate, and GET /tracks/{carrier}/{tracking_number} for real tracking status. Public surface is exactly ShippingAdapter; depends on @mercatus-liber/shipping for the types it implements plus its manual adapter’s carrier-detection-from-tracking-number-format helper (Shippo’s tracking endpoint is addressed by carrier, but ShippingAdapter.getTrackingStatus takes only a bare tracking number), @mercatus-liber/core for the shared Money type its rate/label mapping produces, and global fetch as the real HTTP client (no new HTTP dependency introduced — mirrors adapter-printful/adapter-printify’s own convention). |
@mercatus-liber/adapter-shipstation | ShippingAdapter (@mercatus-liber/shipping) backed by ShipStation API v2 (api.shipstation.com/v2, API-Key header): POST /v2/rates for rates, POST /v2/labels/rates/{rate_id} to buy a label, PUT /v2/labels/{label_id}/void to void one, and GET /v2/labels/{label_id}/track for tracking by label id. Built from ShipStation’s published OpenAPI spec, tested against fakes, never called against a live account. Uses global fetch; no HTTP dependency. |
@mercatus-liber/adapter-shopify | CatalogPersistenceAdapter backed by Shopify’s Admin GraphQL API (subsystem 00’s third reference implementation). Proves the persistence/commerce-backend interface can wrap an entire third-party platform, not just a raw DB — lets a client already on Shopify adopt Mercatus Liber’s admin/AI-agent/plugin layer without migrating off Shopify. Public surface is exactly CatalogPersistenceAdapter; depends on @mercatus-liber/core only. |
@mercatus-liber/adapter-simplyprint | FulfillmentAdapter for a store that prints in-house: puts a paid order line into the SimplyPrint print queue of the store’s own printer farm, and reports when the print is done. It ships nothing. |
@mercatus-liber/adapter-slant3d | FulfillmentAdapter for Slant 3D, a US 3D print farm with a public order API: draft and process orders, price a file, verify webhooks. |
@mercatus-liber/adapter-sqlite | Reference persistence adapter backed by SQLite. Implements @mercatus-liber/core’s repository interfaces — its public surface is exactly those interfaces, no SQLite-specific types leak out. Chosen as the first reference adapter for lowest local-dev friction (no external DB service required); @mercatus-liber/adapter-postgres proves the same contract with a second backend. |
@mercatus-liber/adapter-x3d | FulfillmentAdapter for X3D Studios, a 3D print farm in Austin, Texas with a self-serve order API: single-colour and sliced multicolour prints, shipped to the customer, with status by polling. |
@mercatus-liber/admin-auth | Authentication and role-based authorization for every /admin route (subsystem 21). Depends on @mercatus-liber/core only — never imports Clerk or any other identity provider; that is @mercatus-liber/adapter-clerk’s job, a separate sibling package. Declares the swappable AdminAuthAdapter contract (getCurrentSession/listAdminUsers/setAdminUserRole), the pure hasPermission(role, action) check across three roles (owner/admin/viewer), and createDefaultAdminAuthAdapter — a zero-infra, local-development-only default gated by a single shared ADMIN_DEV_PASSWORD env var, never a production access-control mechanism. |
@mercatus-liber/admin-ui | React components for a Mercatus Liber store’s admin: print coverage drawings, an art version editor, a ratings table and an option matrix configurator. Styled with the theming package’s CSS variables; data and actions come in as props. |
@mercatus-liber/advertising | Admin-curated advertising campaigns/creatives filling CMS’s ad-slot component with real content, plus stateless weighted-random rotation among currently-eligible creatives (subsystem 19). Depends on @mercatus-liber/core only — never imports @mercatus-liber/cms, @mercatus-liber/service-areas, @mercatus-liber/catalog, @mercatus-liber/marketing-catalog, @mercatus-liber/cart, @mercatus-liber/checkout-orders, @mercatus-liber/promotions, @mercatus-liber/bundles, @mercatus-liber/recommendations, @mercatus-liber/inventory, or @mercatus-liber/analytics. Targeting fields (serviceAreaId, pageSlug) are bare strings never validated against any other subsystem here, matching recommendations’ deliberately thin posture. |
@mercatus-liber/agent-commerce | Lets AI agents find, browse and buy from a store for the people they work for: a public shopper-only MCP endpoint, llms.txt and an MCP server card. On by default; a store turns it off with agentAccess: false or AGENT_ACCESS=off. |
@mercatus-liber/ai-interface | AI/MCP interface (subsystem 14) — protocol-agnostic JSON Schema tool definitions + handlers wrapping commerce operations, plus an MCP server. Depends on @mercatus-liber/core for shared types only; every operation is a narrow structural interface, satisfied by the real subsystem services without a package import, same pattern as every other subsystem. |
@mercatus-liber/analytics | AnalyticsAdapter interface + event-bus subscriber (subsystem 13). Depends on @mercatus-liber/core only — a one-directional read-only subscriber over the existing event bus, never a dependency of any other subsystem. Ships a PostHog reference adapter enabled by default, plus a no-op adapter for disabled/privacy-conscious deployments. |
@mercatus-liber/auto-update | Reads a scaffolded store’s mercatus-liber.config.json manifest, checks @mercatus-liber/* package versions against an injectable registry client, and applies updates only if the target project’s own test suite still passes afterward — rolling back otherwise. The auto-update half of the commercial thesis (epic deploy-tool-and-auto-update). Depends on @mercatus-liber/create-store’s manifest module only. |
@mercatus-liber/bundles | Multi-product bundles sold as a single purchasable tier selection on a PDP (subsystem 17). Depends on @mercatus-liber/core only — never imports @mercatus-liber/cart, @mercatus-liber/checkout-orders, @mercatus-liber/promotions, @mercatus-liber/inventory, or @mercatus-liber/catalog. Declares its own narrow SkuPriceLookup structural interface (satisfied by catalog’s CatalogService at the app-composition layer) to validate skuIds and compute a tier’s live sum-of-parts price, recomputed on every read and never cached into the Bundle record. |
@mercatus-liber/cart | Long-lived cart engine (subsystem 07). Depends on @mercatus-liber/core only. Reads SKU data through a narrow structural SkuLookup interface (satisfied by @mercatus-liber/catalog’s CatalogService, but never imports that package) — no dependency on checkout-orders or payments; those subsystems depend on cart, not the reverse. |
@mercatus-liber/catalog | Product/SKU/attribute engine (subsystem 01). Depends on @mercatus-liber/core only — persistence is injected via CatalogPersistenceAdapter, never imported concretely, so this package works with any adapter (adapter-sqlite is a devDependency for tests only). |
@mercatus-liber/checkout-orders | Checkout flow + Order entity (subsystem 09). Depends on @mercatus-liber/core only — cart and payments are satisfied via narrow structural interfaces (CartLookup, PaymentSessionCreator), never imported directly. Never imports inventory or account — reacts to/publishes events for them instead. |
@mercatus-liber/cms | Per-page CMS for the 5 founder-specified page types (subsystem 05) — home, category, marketing/campaign, search, PDP. Component registry + marketing pages’ own curated mini-catalog. Depends on @mercatus-liber/core only; references product/category ids without importing catalog or marketing-catalog. |
@mercatus-liber/community-goals | Vote-threshold-gated feature unlocks (subsystem 26) — a storefront publishes a Goal (a vote target, e.g. “1000 votes unlocks the live print stream”), customers/visitors cast one vote each (deduped by a caller-supplied voterKey), and the goal’s status derives from voteCount vs its thresholds. Depends on @mercatus-liber/core only. Carries no UI/animation concern of its own — the progress-bar/liquid-fill/gradient rendering a storefront builds on top of GoalStatus’s plain numbers is entirely the storefront’s own design-system work, same separation PDP/theming already draws from catalog. |
@mercatus-liber/core | Shared core schema types and adapter/event-bus interfaces. Types and interfaces only — no storage, no business logic, no framework code. @osc is a placeholder scope for the project’s working name (see docs/NAMING-CANDIDATES.md); rename when the real name is picked. |
@mercatus-liber/create-store | Scaffolds a new deployable Mercatus Liber store — the deploy-tool half of the commercial thesis (epic deploy-tool-and-auto-update). Generates a package.json wired to the chosen adapter, a minimal service-composition entry point, and mercatus-liber.config.json (the manifest @mercatus-liber/auto-update reads). |
@mercatus-liber/customization | Made-to-order product customization: a shared color palette, finish tiers, per-part color rules, availability status, and an admin-defined pricing engine. No rendering code. |
@mercatus-liber/customization-ui | Default customizer UI as a framework-agnostic Web Component. Rendering only: no persistence or network calls. Currently holds its own copy of the color-resolution logic. |
@mercatus-liber/fulfillment | Per-order-line fulfillment routing and status (subsystem 41). Depends on @mercatus-liber/core only; reads orders via a narrow structural interface (OrderLookup), never importing @mercatus-liber/checkout-orders directly. Owns a FulfillmentRoutingRepository (skuId -> provider-key mapping, defaulting every SKU to ‘manual’) and the FulfillmentAdapter contract every real provider adapter implements, mirroring @mercatus-liber/payments’ PaymentAdapter shape. Ships createManualFulfillmentAdapter() as the zero-infra default — models today’s implicit reality (an operator fulfills by hand) and the permanent fallback for self-fulfilled SKUs even once a real dropship/POD adapter exists. |
@mercatus-liber/internal-bi | Owned, internal business-intelligence layer — revenue over time, order volume, top products, conversion funnel, promotion redemption rates, and (contract-only) inventory turns — architected as an explicit, swappable BiMetricsAdapter contract (subsystem 20). Depends on @mercatus-liber/core only; reads orders/skus/promotions via narrow structural interfaces, never importing @mercatus-liber/checkout-orders, @mercatus-liber/catalog, or @mercatus-liber/promotions directly. The conversion funnel is backed by its own small, in-memory, going-forward-only event log, populated by subscribing to a fixed allow-list of existing bus events — never a direct call into any other subsystem. |
@mercatus-liber/inventory | Stock levels per SKU via reserve/commit/release (subsystem 11). Depends on @mercatus-liber/core only; reads order line items via a narrow structural OrderLookup interface, never importing @mercatus-liber/checkout-orders directly. Default in-house adapter allows oversell/backorder (never throws) — see this package’s design decisions. |
@mercatus-liber/marketing-catalog | Categories layered on the product catalog, genuinely separate from it (subsystem 02 — the gap that motivated this project). Depends on @mercatus-liber/core only; reads product attributes via a narrow structural CatalogAttributeLookup interface, never importing @mercatus-liber/catalog directly. |
@mercatus-liber/media | Image-CDN subsystem (image-cdn epic): owns the ImageAdapter contract every real image-CDN/transform provider implements (mirrors @mercatus-liber/payments’ PaymentAdapter and @mercatus-liber/shipping’s ShippingAdapter shape — a small interface the app wires at startup, swappable with zero changes anywhere else). Depends on @mercatus-liber/core only for the ProductImage type it operates on. Ships createPassthroughImageAdapter() as the zero-infra default — returns the source URL unchanged, a genuinely honest “no transform/optimization available” default, never a fabricated resized URL. |
@mercatus-liber/migrate-shopify | One-time Shopify-to-native migration tool (epic shopify-migration-import-tool). This is NOT @mercatus-liber/adapter-shopify, which is a live wrapper that proxies catalog reads/writes through Shopify’s API forever — this package reads a merchant’s existing Shopify store exactly once and writes the result into Mercatus Liber’s own native persistence through the real CatalogService/MarketingCatalogService/InventoryAdapter, so a merchant can actually leave Shopify. Dry-run by default; idempotent (safe to re-run) by construction. Orders/customers and images/media migration are explicitly out of scope for this first pass — see this package’s README. |
@mercatus-liber/payments | PaymentAdapter interface + Stripe Checkout Sessions reference adapter (subsystem 08). Depends on @mercatus-liber/core only — no dependency on cart, catalog, or checkout-orders. Never touches card data; delegates PCI/tax entirely to Stripe’s hosted Checkout + Stripe Tax. |
@mercatus-liber/pdp | Product Display Page data/behavior contract (subsystem 04). Depends on @mercatus-liber/core + @mercatus-liber/theming (a leaf with no adapter-swapping story, so a real import is fine); reads catalog via a narrow structural ProductLookup interface, never importing @mercatus-liber/catalog directly. |
@mercatus-liber/plugins | Plugin lifecycle + registry (subsystem 12). Depends on @mercatus-liber/core only — a plugin’s entire default surface is core types plus the event bus. Every adapter interface defined elsewhere is already a plugin point by construction; this package’s job is the event-subscription extension point plus one reference plugin. Core subsystems must never import from this package — only the reverse. |
@mercatus-liber/print-art | Versioned custom print art: immutable numbered versions (code first, then editor-saved), pins that decide what a store sells, print-file names that can only show a saved version, a framework-free print-file handler, a layout catalog and print coverage maths. No rendering code: the store supplies the renderer. |
@mercatus-liber/promotions | Coupon codes and percentage/fixed discounts, cart-level and product-level (subsystem 16). Depends on @mercatus-liber/core only — never imports @mercatus-liber/cart, @mercatus-liber/checkout-orders, or @mercatus-liber/catalog. Product-scope promotions store bare skuId strings and are validated against a cart’s own line items at evaluation time, not resolved through catalog. Publishes promotions.redeemed; subscribes to checkout.order.paid to increment redemption counts on completed purchases only. |
@mercatus-liber/recommendations | Admin-curated, explicit product-to-product recommendations (“Customers also bought”) for the PDP and cart page (subsystem 18). Depends on @mercatus-liber/core only — never imports @mercatus-liber/cart, @mercatus-liber/checkout-orders, @mercatus-liber/promotions, @mercatus-liber/bundles, @mercatus-liber/inventory, @mercatus-liber/catalog, or @mercatus-liber/analytics. Deliberately thinner than promotions/bundles: it never validates product ids against catalog at write time — product ids are stored as bare strings and resolved by the app-composition layer at render time. |
@mercatus-liber/reviews | Product reviews and star ratings (bare-basics epic). Depends on @mercatus-liber/core only — never imports @mercatus-liber/catalog, referencing products by bare productId, the same structural-dependency posture as @mercatus-liber/promotions/recommendations. Every review starts in “pending” status (a real moderation queue, not auto-publish) — getRatingSummary/listReviewsForProduct’s public-facing calls only ever aggregate/return “published” reviews, so a submitted-but-unmoderated review can never appear on a live PDP. Publishes reviews.review.submitted and reviews.review.published on the injected EventBus. |
@mercatus-liber/search | SearchIndexAdapter interface + default in-memory implementation (subsystem 03). Depends on @mercatus-liber/core only; syncs with catalog purely by reacting to event-bus notifications through a narrow structural ProductDataLookup interface, never importing @mercatus-liber/catalog directly. |
@mercatus-liber/service-areas | ServiceArea entity + product<->area assignment (subsystem 15) — the multi-location marketing pattern a service-area business needs. Depends on @mercatus-liber/core only; catalog never depends on this package, same one-directional rule as marketing-catalog (02). See docs/subsystems/15-service-areas.md. |
@mercatus-liber/shipping | Physical shipping-transaction subsystem (epic shipping-rate-and-labels): rate shopping, label purchase, and tracking for a self-fulfilled order line. Depends on @mercatus-liber/core only. Distinct from @mercatus-liber/fulfillment (epic 41), which routes who produces/ships a line — this subsystem is the physical shipping transaction itself, needed even when a line has no external fulfillment provider at all. Owns the ShippingAdapter contract every real carrier adapter implements (mirrors @mercatus-liber/payments’ PaymentAdapter and @mercatus-liber/fulfillment’s FulfillmentAdapter shape) and ships createManualShippingAdapter() as the zero-infra default — a genuinely honest documented-manual-workflow (PirateShip has no public API, confirmed by research, not assumed), never fabricated rate/label data. |
@mercatus-liber/store-api | An authenticated HTTP API for outside apps, such as flayr, to read a store’s catalog, run its promotions, and subscribe to its events. |
@mercatus-liber/store-client | A typed client for a Mercatus Liber store API, plus webhook signature checks. No dependencies, and runs anywhere fetch and Web Crypto do. |
@mercatus-liber/storefront-ui | Common React components for a Mercatus Liber storefront. Styled with the theming package’s CSS variables, with data and actions passed in as props. |
@mercatus-liber/storefront-views | Storefront views (storefront-views-and-multi-catalog epic): a named, curated presentation layer over ONE store’s already-real catalog — a category subset, its own hero copy, an optional theme override — addressable at its own route without duplicating catalog/cart/checkout/PDP/PLP logic. Depends on @mercatus-liber/core only, referencing categoryIds/demoSlug by bare string ids, the same structural-dependency posture as @mercatus-liber/promotions/recommendations/reviews. Three real patterns this makes possible with the SAME mechanism: (1) a permanent second storefront over a shared catalog (a ‘parts counter’ split, or two differently-curated storefronts over one inventory); (2) a time-boxed campaign takeover (getActiveDefaultOverride considers real startsAt/endsAt against the current time, so a seasonal microsite becomes the store’s default home page for its real window and automatically reverts after — no manual revert action needed); (3) multiple fully separate brands/catalogs is already what this repo’s own multi-demo routing provides (each demo store is its own isolated catalog instance) and needs no new code here. |
@mercatus-liber/theming | Layout template registry + style tokens (subsystem 06). A leaf package — depends on @mercatus-liber/core only, framework-agnostic (no React/Next types). CMS over theming: no forced whole-site theme, just a small default template set per page type that a deployment can override. |
@mercatus-liber/webhooks | Outbound webhook delivery for the event bus (epic outbound-webhook-event-delivery). @mercatus-liber/core’s EventBus (packages/core/src/event-bus.ts) is purely in-process — there was zero mechanism for an external consumer (Zapier/Make/n8n, a merchant’s own backend) to register a URL and receive a real HTTP POST when a subsystem publishes an event. This package extends the bus, it doesn’t replace it: a WebhookDeliveryService subscribes to a known set of real event names on an injected EventBus and fans each matching publish out to every active WebhookSubscription registered for that event type, as a real HTTP POST with an HMAC-SHA256 signature (mirroring adapter-printify’s verifyPrintifySignature’s exact sha256={hex}-over-the-raw-body convention, applied outbound) in the x-mercatus-liber-signature header, real bounded retry/backoff on delivery failure, and a durable delivery log. Depends on @mercatus-liber/core only (EventBus, referenced structurally). A durable (Postgres) WebhookSubscriptionStore/WebhookDeliveryLogStore pair lives in @mercatus-liber/adapter-postgres (webhooks.ts), same split as every other subsystem’s in-memory-default/Postgres-second-adapter pattern. |