← back to Pattern Vault

scripts/add-pdl-voice.mjs

45 lines

#!/usr/bin/env node
// Add PDL-voiced descriptions to the lead-collection manifest. Pattern Design Lab's register:
// atelier/"laboratory of pattern design", editorial, spec-like + spatial, for designers &
// architects (plum/Playfair). Replaces marketplace-generic copy. Each carries a tasteful,
// compliant AI-disclosure clause. Writes `descriptionPDL` alongside the existing `description`
// so the PDL session can pick. Idempotent (overwrites descriptionPDL on re-run).
//
// Usage: node scripts/add-pdl-voice.mjs   (run after build-lead-collection.mjs)

import fs from 'node:fs';
import path from 'node:path';
import { fileURLToPath } from 'node:url';

const ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
const FILE = path.join(ROOT, 'data/lead-collection.json');
const DISCLOSURE = ' Conceived in the Lab with AI-assisted generative tools and refined by hand — an original, seamless repeat.';

const COPY = {
  'PV-INHOUSE-002': 'Blush peonies opening against an ink-black ground — a nocturne of a pattern, romantic and a little dangerous. Made for a statement wall: a dining room, a powder room, a headboard elevation you want remembered.',
  'PV-INHOUSE-m_plum': 'Plum blooms dissolving into an aubergine-black field — tonal, velvety, nearly monochrome. The moody floral for anyone who finds black florals too obvious; it broods in colour instead.',
  'PV-INHOUSE-m_emerald': 'Blush camellias suspended in an emerald-black depth — jewel-box botany with real saturation. Lush enough for a bar or a library, restrained enough to live with.',
  'PV-INHOUSE-lane2b': 'Burgundy roses smouldering over charcoal — the moody floral at its most romantic and least shy. A dining room in candlelight; a boutique fitting room; anywhere you want a slow intake of breath.',
  'PV-INHOUSE-lane2c': 'Ivory magnolias floating on a deep-teal ground — cool, lacquered, quietly opulent. The nocturne for a jewel-box space: a powder room, a bar, a niche that deserves drama.',
  'PV-INHOUSE-001': 'A measured heritage trellis in forest green and cream drawn across soft sage — the botanical that holds a whole room without shouting. Reads as heirloom at scale, equally at home in a panelled study or a boutique-hotel corridor.',
  'PV-INHOUSE-h_black': 'Antique-gold boughs traced over deep charcoal — heritage botany in the register of a lacquered screen. Gilded but grown-up; it warms a dark room rather than swallowing it.',
  'PV-INHOUSE-h_blush': 'A soft heritage trellis, sage vine over rosewater blush — gentle without turning saccharine. A natural for a nursery that still reads at fifteen, a dressing room, a sunlit landing.',
  'PV-INHOUSE-lane1b': 'Deep-indigo vine climbing an oatmeal ground — heritage trellis with the confidence of a single, saturated colourway. Crisp, architectural, endlessly liveable in a hall or a home office.',
  'PV-INHOUSE-lane1c2': 'A heritage ditsy — terracotta and olive vine scattered across bone — small in scale, generous in charm. The workhorse floral: a mud room, a cottage bedroom, the inside of a cabinet opened daily.',
  'PV-INHOUSE-lane3b': 'A loose painterly floral, blush and sage washed over warm cream — watercolour softness with a designer’s restraint. Feels hand-painted on the wall; ideal for a bedroom or a sunroom that wants air.',
  'PV-INHOUSE-lane6': 'An indigo-and-terracotta block-print geometry on cream — the hand of a folk tile without the kiln. Graphic enough to anchor an entry, warm enough for a kitchen or a well-travelled study.',
  'PV-INHOUSE-lane4': 'A mid-century meadow in mustard, teal and burnt-orange — atomic-era optimism redrawn with a modern hand. Brings warmth and wit to a breakfast nook, a studio, a child’s room that refuses to be twee.',
  'PV-INHOUSE-lane5': 'Irregular tide-line stripes in faded navy, sage and sand — coastal without a single anchor or shell in sight. Quietly directional; runs beautifully up a stairwell or behind open shelving.',
};

const manifest = JSON.parse(fs.readFileSync(FILE, 'utf8'));
let n = 0, missing = [];
for (const item of manifest.items) {
  if (COPY[item.id]) { item.descriptionPDL = COPY[item.id] + DISCLOSURE; n++; }
  else missing.push(item.id);
}
manifest._voice = 'descriptionPDL = Pattern Design Lab atelier voice (plum/Playfair). description = marketplace-generic fallback. Both carry AI disclosure.';
fs.writeFileSync(FILE, JSON.stringify(manifest, null, 2));
console.log(`PDL-voiced ${n}/${manifest.items.length} items` + (missing.length ? ` — MISSING copy for: ${missing.join(', ')}` : ' — all covered'));
manifest.items.forEach((i) => console.log(`  · ${i.title}\n    ${(i.descriptionPDL || '(none)').slice(0, 96)}…`));