[object Object]

← back to All Designerwallcoverings

all.dw: dedupe microsite seeds by vendor (fold DB auto-slug into registry brand slug); point Pierre Frey at live hyphenated host pierre-frey (401 gated)

9c2f43abbceb8ebd8df82b0c01824ec6a1fab26a · 2026-07-07 13:12:36 -0700 · steve@designerwallcoverings.com

Files touched

Diff

commit 9c2f43abbceb8ebd8df82b0c01824ec6a1fab26a
Author: steve@designerwallcoverings.com <steve@designerwallcoverings.com>
Date:   Tue Jul 7 13:12:36 2026 -0700

    all.dw: dedupe microsite seeds by vendor (fold DB auto-slug into registry brand slug); point Pierre Frey at live hyphenated host pierre-frey (401 gated)
---
 config/known-subdomains.json |  4 ++--
 scripts/crawl-microsites.js  | 10 ++++++++--
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/config/known-subdomains.json b/config/known-subdomains.json
index 8738d20..d2dc800 100644
--- a/config/known-subdomains.json
+++ b/config/known-subdomains.json
@@ -33,10 +33,10 @@
    "internalViewer": "http://127.0.0.1:9947 (~/Projects/quadrille-internal, pm2 quadrille-internal)"
   },
   {
-   "slug": "pierrefrey",
+   "slug": "pierre-frey",
    "vendor": "Pierre Frey",
    "knownProject": "~/Projects/dw-vendor-microsites/vendors/pierre_frey",
-   "note": "Canonical customer subdomain = pierrefrey (no hyphen, per Steve). Samples-only vendor viewer (dw-vendor-microsites wave-19, internal vendor_code pierre_frey / fieldmap subdomain pierre-frey — ALIGN deploy to pierrefrey). ~1,161 wallpaper SKUs from pierrefrey.com onboarding to pierre_frey_catalog; Shopify import DRAFT/quote-only. Staged, public launch gated.",
+   "note": "LIVE (gated, 401) at pierre-frey.designerwallcoverings.com — dw-vendor-microsites wave-19 samples viewer. Canonical host uses the HYPHEN (matches deploy). ~1,161 wallpaper SKUs from pierrefrey.com onboarding to pierre_frey_catalog; Shopify import DRAFT/quote-only. Fatten viewer 46→~1,161 on scrape completion; public un-gate is launch-gated.",
    "hasMicrosite": true,
    "internalViewer": "http://127.0.0.1:10066 (dw-vendor-microsites pierre_frey viewer)"
   }
diff --git a/scripts/crawl-microsites.js b/scripts/crawl-microsites.js
index ef16822..bc138dc 100644
--- a/scripts/crawl-microsites.js
+++ b/scripts/crawl-microsites.js
@@ -82,10 +82,16 @@ async function seedFromDb() {
 
 function mergeSeeds(reg, db) {
   const bySlug = new Map();
+  // A registry brand can pin a canonical slug for a vendor whose auto-slug differs
+  // (brand slug "pierre-frey" vs slugify("Pierre Frey")="pierrefrey"). Fold the
+  // DB-derived twin into the registry entry by vendor so we don't emit a dark duplicate.
+  const vendorToSlug = new Map();
+  for (const s of reg) if (s.vendor) vendorToSlug.set(String(s.vendor).toLowerCase(), s.slug);
   for (const s of [...reg, ...db]) {              // registry first, DB fills gaps
     if (!s.slug || BANNED.test(s.slug) || BANNED.test(s.vendor || '')) continue;
-    const prev = bySlug.get(s.slug);
-    bySlug.set(s.slug, prev ? { ...s, ...prev, activeProductsDB: prev.activeProductsDB ?? s.activeProductsDB, dbSampleImage: prev.dbSampleImage ?? s.dbSampleImage } : s);
+    const key = (s.vendor && vendorToSlug.get(String(s.vendor).toLowerCase())) || s.slug;
+    const prev = bySlug.get(key);
+    bySlug.set(key, prev ? { ...s, ...prev, activeProductsDB: prev.activeProductsDB ?? s.activeProductsDB, dbSampleImage: prev.dbSampleImage ?? s.dbSampleImage } : s);
   }
   return [...bySlug.values()];
 }

← d0fcf53 chore: lint + light refactor (shared adapter helpers, named  ·  back to All Designerwallcoverings  ·  live-stock: vault-cred adapter for Thibaut (creds referenced a35f788 →